Skip to main content

Setting Up The Callback

Override uniswapV3FlashCallback with the arbitrage logic.
Decode the data and validate the callback origin:
Approve the router and set minimum output amounts (borrowed + fees) so swaps revert if unprofitable:

Executing The Swaps

Swap the flash-borrowed tokens in pools with different fee tiers:

Paying Back The Pool And Collecting Profits