This lesson will extend the arbitrage strategy to include Uniswap V4/V3 pairs. It builds heavily on the previous project and the discussion of V4 and V3 callbacks. I recommend reviewing both articles before proceeding.
Testing Results
As mentioned in the callback article, I deployed a single-focus contract last week with a bot to monitor V4/V3 paths on Base.
Volatility during the past week was quite high, particularly in stablecoin pairs. A good test case for sure!
The bot found and captured many opportunities — accounting at time of writing is ~0.05 Ether gross profit over ~15k transactions. Since this was a limited scope exercise as a proof of concept, I have not done a full tally of gas fees or analyzed the success/revert ratio.
Considering the relatively low TVL of Uniswap V4 on Base, I’m encouraged by these results. Further, I observed many different arbitrage transactions over the week that covered all of the profit token combinations (V4 WETH→V3 WETH, V3 WETH→V4 WETH, V4 Ether→V3 WETH, and V3 WETH→V4 Ether).
Smart Contract
Keep reading with a 7-day free trial
Subscribe to Degen Code to keep reading this post and get 7 days of free access to the full post archives.