DEX Arbitrage Bot
A DEX arbitrage bot captures price differences across decentralized exchanges. Liquidity on Ethereum is fragmented across Uniswap V2, V3, V4, Sushiswap, Curve, Balancer V2, PancakeSwap V3, FraxSwap, Maverick, DODO, and dozens of smaller AMMs. Whenever a large trade lands on one of them, its price diverges from the others — and an arbitrage bot races to close the gap. The same WETH/USDC pair trades on at least 8 venues on Ethereum mainnet, and Uniswap V3 alone has 0.01%, 0.05%, 0.30%, and 1.00% fee-tier variants of each pool — effectively making each tier an independent venue with its own price. DEX arbitrage is the cleanest form of MEV: no victim, no front-running, just price alignment. Top operators capture spreads in single-digit milliseconds, executing the round-trip atomically inside a single Ethereum block.
DEX arbitrage is one of the cleanest forms of MEV: no victim, no front-running, just keeping prices aligned. This guide covers pool topology, cross-DEX path-finding, CEX-DEX arbitrage with hedged inventory, and the atomic execution patterns production bots use.
- What is DEX arbitrage?
- Why DEX prices diverge
- Uniswap V2 vs V3 vs V4 arbitrage
- Curve and Balancer arbitrage
- CEX-DEX arbitrage
- Aggregator arbitrage (1inch, 0x, CowSwap)
What is DEX arbitrage?
DEX arbitrage is the practice of buying a token on one decentralized exchange and selling it on another to capture a price difference. Because Ethereum DEXs operate as independent automated market makers (AMMs), they don't share an order book — each pool maintains its own reserves and prices the token according to its own bonding curve. When a swap lands on one pool, only that pool's price updates; the others stay where they were until an arbitrage trade re-aligns them. DEX arbitrage bots compete to be the first to capture each gap.
Why DEX prices diverge
Three structural reasons prices diverge across DEXs:
- Fragmented liquidity. The same WETH/USDC trades on at least 8 venues. Large trades on one move that venue's price; the others lag.
- Different fee tiers. Uniswap V3 alone has 0.01%, 0.05%, 0.30%, and 1.00% fee tiers. Each is essentially a separate pool with its own price.
- Different curve shapes. Uniswap uses constant-product (x×y=k); Curve uses stableswap (designed for like-priced assets); Balancer uses weighted (multi-asset with custom weights). The same token reserves yield different prices on different curves.
Uniswap V2 vs V3 vs V4 arbitrage
Each Uniswap version has its own arbitrage characteristics:
- Uniswap V2: simple constant-product pools. Easy to price, fast to simulate. Most long-tail tokens live here. Highest gas per swap (~85k gas).
- Uniswap V3: concentrated liquidity in specific tick ranges. Most efficient for major pairs (WETH/USDC, WETH/USDT) but harder to simulate (requires reading tick bitmaps). ~110k gas per swap.
- Uniswap V4: hooks-based architecture with custom logic per pool. Arbitrage bots need to handle hook execution carefully — some hooks revert in unexpected conditions.
Cross-version arbitrage (V2 ↔ V3) is one of the steadiest opportunity sources on Ethereum. The pools have different liquidity depths and respond differently to large trades, so divergences are common.
Curve and Balancer arbitrage
Curve uses the stableswap curve, designed to provide nearly 1:1 trading between like-priced assets (stablecoins, ETH derivatives). Curve arbitrage opportunities tend to be smaller per trade but very frequent — stablecoin depegs of 0.1–0.5% provide arbitrage opportunities through Curve's tricrypto, 3pool, and steth pools. Balancer arbitrage is interesting because Balancer pools can hold multiple tokens with custom weights (80/20 BAL/WETH, for example) and offer fee-free flash loans on top. Production bots route many flash-loan arbitrage paths through Balancer's Vault for the zero-fee loan.
CEX-DEX arbitrage
CEX-DEX arbitrage compares prices on Binance, Coinbase, OKX, or Bybit against DEX prices on Uniswap or Curve. The challenge is that the two legs aren't atomic — there's settlement risk between the on-chain swap and the off-exchange trade. Institutional MEV operators (Wintermute, Jump Crypto, GSR) handle this by holding inventory on both sides, turning the strategy into market making across venues. Retail tools can approximate it by maintaining USDC/USDT balances on a CEX and ETH/WETH on-chain, then taking opportunities whenever spreads exceed the inventory rebalancing cost. See the arbitrage bot overview for the broader category.
Aggregator arbitrage
DEX aggregators (1inch, 0x, Cowswap, Paraswap, OpenOcean) route user trades through optimal multi-DEX paths. They constantly recalculate the best route each block, effectively eliminating the simplest arbitrage opportunities — if 1inch sees WETH cheaper on Sushiswap, it'll route the user's trade there. This is why pure two-leg DEX arbitrage on the largest pairs (WETH/USDC, WETH/USDT) is highly competitive and razor-thin. The remaining DEX arbitrage opportunities concentrate in longer paths (3–5 legs through less-trafficked pools), in pools that aggregators haven't indexed yet, and in volatile market regimes when prices move faster than aggregators can refresh.
Further reading and references
- Flashbots MEV-Inspect (cross-DEX classification) — Open-source pipeline that classifies cross-DEX arbitrage paths and operator-level attribution.
- Paradigm: MEV after EIP-1559 — How the priority-fee market changed arbitrage bidding dynamics.
- Uniswap V3 whitepaper — Concentrated liquidity model that drives most cross-DEX price divergence.
- CowSwap protocol docs — Intent-based aggregator that batches orders and runs a solver auction off the public mempool — the kind of aggregator MEV bots cannot front-run directly.
- 1inch Aggregation Protocol docs — Reference for path-finding across 200+ liquidity sources; the canonical aggregator MEV bots try to outcompete on specific routes.
- Curve StableSwap whitepaper — The hybrid invariant Curve uses for like-priced assets; the formula matters for any bot routing through Curve pools.
One MEV bot, three strategies — multi-layer sandwich, flash-loan arbitrage across Uniswap V2/V3/V4 + Curve + Balancer + Sushi, and lending liquidation. All run in parallel.
See pricing →