Triangular Arbitrage Bot

By MevLex Research · MEV Research & Engineering · Updated 2026-05-17

Triangular arbitrage routes capital through three tokens in a closed loop to capture price misalignment. Start with USDC, swap to WETH, swap to WBTC, swap back to USDC. If the three pairwise prices are misaligned by enough to cover gas + fees, you end with more USDC than you started. In any market with three or more assets, the pairwise prices must be consistent: if 1 WETH = 3,000 USDC and 1 WBTC = 60,000 USDC, then 1 WBTC must equal 20 WETH. When the WBTC/WETH pool deviates from 20 — say 20.05 — there's a triangular arbitrage opportunity. On Ethereum DEXs, three-leg paths typically cost 60–200 basis points combined (gas + fees + slippage). On Binance, where each leg only costs 0.1% (or 0.075% with BNB rebate), the threshold to profitable opportunities is much lower — and competition is far tighter.

THREE-LEG CYCLE · ATOMICUSDC$1,000,000WBTC~14.78 BTCWETH~285 ETHstep 1 · Uniswap V3USDC → WETHstep 2 · CurveWETH → WBTCstep 3 · SushiSwapWBTC → USDCPROFIT = USDC out − USDC in − gas (positive only if cycle has price imbalance)
Triangular arbitrage — three swaps return to the starting token with a profit

Triangular arbitrage is a subset of crypto arbitrage and works on both centralized exchanges (Binance, Coinbase) and Ethereum DEXs (Uniswap, Curve, Balancer). This guide explains the routing math, path-finding algorithms, and why DEX triangular arbitrage is harder than CEX triangular arbitrage.

On this page
  1. What is triangular arbitrage?
  2. Three-leg routing on Uniswap
  3. Triangular arbitrage on Binance
  4. Hummingbot triangular arbitrage setup
  5. Why DEX triangular arbitrage is harder than CEX

What is triangular arbitrage?

In any market with three or more assets, the pairwise prices must be consistent. If 1 WETH = 3,000 USDC and 1 WBTC = 60,000 USDC, then 1 WBTC should equal 20 WETH. When the WBTC/WETH pool deviates from 20 — say it's actually trading at 20.05 — there's a triangular arbitrage opportunity: convert WBTC → USDC → WETH → WBTC and end with more WBTC than you started, because one of the three pairs is mispriced.

On a single venue (one CEX, or one DEX), triangular arbitrage is well-understood and very competitive. Every trading firm runs it. Spreads are usually 0.01–0.10% per opportunity, and the bot that detects + executes fastest wins.

Three-leg routing on Uniswap

On Uniswap, a triangular arbitrage path is three sequential swaps in a single atomic transaction:

  1. Swap USDC → WETH on Uniswap V3 USDC/WETH 0.05% pool.
  2. Swap WETH → WBTC on Uniswap V3 WETH/WBTC 0.30% pool.
  3. Swap WBTC → USDC on Uniswap V3 WBTC/USDC 0.30% pool.

Each leg incurs the pool's fee + price impact. The combined cost must be less than the price misalignment for the opportunity to be profitable. Path-finding algorithms (Bellman-Ford, SPFA) continuously evaluate every possible 3-leg cycle across the universe of tracked pools to identify profitable opportunities.

Triangular arbitrage on Binance

Binance offers thousands of trading pairs, including most three-token combinations. Triangular arbitrage on Binance is one of the most popular automated strategies because: trades are atomic at the venue level (no on-chain settlement), fees are low (0.1% standard, 0.075% with BNB rebate), latency is low (millisecond order placement). The trade-off is competition — every major retail bot platform supports Binance triangular arbitrage out of the box, so spreads are razor-thin and only the fastest bots capture them.

Hummingbot triangular arbitrage setup

Hummingbot is the most credible open-source triangular arbitrage tool. Configuration involves: defining the three tokens (e.g., BTC/ETH/USDT), connecting your exchange API keys, setting minimum profit threshold (typically 0.1–0.3%), and starting the strategy. Hummingbot continuously monitors the three pairs, calculates the arbitrage opportunity each tick, and executes when the threshold is met. Spreads on Binance triangular arbitrage are tight enough that you'll see opportunities mostly during high-volatility windows; in steady markets, the strategy will sit idle.

Why DEX triangular arbitrage is harder than CEX

On a CEX, each leg of a triangular arbitrage executes against an order book at the posted bid/ask — the cost is the spread plus fees. On a DEX, each leg incurs the pool's fee (5–100 bps) plus price impact (which scales with trade size). Three DEX legs typically cost 60–200 basis points combined, while three CEX legs cost 30–60 basis points. The gross spread on a DEX triangular arbitrage opportunity has to be substantially larger to net profit. As a result, DEX triangular arbitrage tends to be opportunistic — concentrated in moments when a large trade pushes one of the three pools out of equilibrium — while CEX triangular arbitrage runs continuously. Production MEV bots like the one behind JaredFromSubway include triangular paths as part of their broader DEX arbitrage engine but rely on sandwich attacks and flash-loan arbitrage for the majority of profit.

Further reading and references

One MEV desk. On-chain arbitrage. Live on Ethereum.

On-chain arbitrage — funded from its own capital (zero flash-loan fees) or flash loans (zero capital at risk), whichever nets more — runs from managed low-latency infrastructure, every trade settling on-chain and independently verifiable. Backed by a 30-day money-back guarantee.

See plans →