Degen Code

Degen Code

Share this post

Degen Code
Degen Code
Uniswap V4/V3 Multi-Pool Arbitrage
Copy link
Facebook
Email
Notes
More

Uniswap V4/V3 Multi-Pool Arbitrage

Part I: Smart Contract Architecture

May 07, 2025
∙ Paid
1

Share this post

Degen Code
Degen Code
Uniswap V4/V3 Multi-Pool Arbitrage
Copy link
Facebook
Email
Notes
More
Share

We’ve spent the last month uncovering techniques for two-pool arbitrage with at least one Uniswap V4 pool.

Project: Uniswap V4/V2 Two-Pool Arbitrage Bot

Project: Uniswap V4/V2 Two-Pool Arbitrage Bot

BowTiedDevil
·
Mar 28
Read full story
Project: Uniswap V4/V3 Two-Pool Arbitrage Bot

Project: Uniswap V4/V3 Two-Pool Arbitrage Bot

BowTiedDevil
·
Apr 8
Read full story
Project: Uniswap V4/V4 Multi-Pool Arbitrage Bot

Project: Uniswap V4/V4 Multi-Pool Arbitrage Bot

BowTiedDevil
·
Apr 16
Read full story

My final rabbit hole for the series is extending the bot to allow arbitrage across multiple V4/V3 pools. But mixing the V4/V3 callbacks together creates considerable complexity. I covered this before sharing the V4/V3 project.

How To Escape Uniswap Callback Hell

How To Escape Uniswap Callback Hell

BowTiedDevil
·
Apr 3
Read full story

The Goal

In general, I’ve been pleased with allowing V3 swaps to perform “self-payment” inside their callback by calling take() at the PoolManager. This allows the execution contract to avoid intermediate custody of forward tokens, minimizing gas costs.

However, we cannot always assume that the V3 swap can be paid by an in-scope V4 swap. Sometimes multiple V3 swaps must be chained together, and the deposit required to pay for a swap may not be available at the time of a particular callback.

This discussion will outline a possible way to implement this functionality. Testing will be necessary, and depending on how it performs I might scrap it and take an alternate route.

I want to combine the recursive callback execution of the V4/V3 bot and the dynamic swap amount model from the multi-pool V4 bot.

The contract must be able to accommodate multiple pools of either type, provided that the sequence is valid (assuming that a forward token cycle exists through all pools without gaps or repeats).

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 BowTiedDevil
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share

Copy link
Facebook
Email
Notes
More