Home › Strategy & Costs › Triangular Arbitrage in Crypto: How Three-Leg Loops Work
Triangular Arbitrage in Crypto: How Three-Leg Loops Work
Triangular arbitrage trades through three assets in a loop, such as ETH to token A to token B and back to ETH, to finish with more ETH than you started with because the three exchange rates are inconsistent. It needs a gap larger than three fees plus slippage and, on Ethereum, gas.
The idea
Any three assets have three prices that should be consistent with each other. If one ETH buys 2,000 units of A, one unit of A buys 0.5 units of B, and one unit of B buys 0.001 ETH, then going around the loop returns exactly 1 ETH and nothing is gained. If the prices are slightly off, the loop returns a bit more or a bit less than 1 ETH. When it returns more, there is a triangular opportunity, and when it returns less, running the loop in the reverse direction might be profitable.
The key feature is that all three trades happen on a single venue or within a single transaction. You do not need to move funds between exchanges, which removes transfer delays and withdrawal fees from the picture. The vendor’s own educational piece on crypto arbitrage trading describes triangular arbitrage in the same terms, as trading through three cryptocurrencies on a single exchange to profit from pricing mismatches.
A worked example with invented rates
These rates are invented to show the arithmetic, not taken from any market.
| Leg | Trade | Rate | Result after leg |
|---|---|---|---|
| Start | 1.000 ETH | 1.000 ETH | |
| 1 | ETH to token A | 2,000 A per ETH | 2,000 A |
| 2 | A to token B | 0.52 B per A | 1,040 B |
| 3 | B to ETH | 0.000965 ETH per B | 1.0036 ETH |
The loop returns 1.0036 ETH, a gross gain of 0.36 percent. Now subtract three pool fees. At 0.3 percent each, that is roughly 0.9 percent, so the loop actually loses about 0.54 percent. For the loop to be profitable at 0.3 percent fees per leg, the mispricing must exceed roughly 0.9 percent before price impact and gas.
Key takeaway: every extra leg adds a fee. A triangular loop needs a larger mispricing than a two-leg trade to break even.
Centralised exchanges versus on-chain
On a centralised exchange, the three trades are separate orders. They are fast, fees can be lower for high-volume accounts, and no gas is needed, but there is execution risk: prices can move between the first and third order, and you might end up holding an asset you did not want. The vendor article cited above lists market volatility and slippage as risks for exactly this reason.
On Ethereum, a smart contract can run all three swaps in one transaction. If the final balance is not higher than the start, the contract reverts. That atomicity removes the stuck-in-the-middle risk but adds gas, which scales with the number of swaps, and exposure to competition for block space. The Uniswap fee documentation lists the fee tiers that apply per pool, and for loops across several pools those fees stack. For the cost math, see gas fees and arbitrage profit.
Finding loops
The search space grows quickly. With N tokens there are many possible triangles, and each can be run in two directions, across several pools per pair. Bots handle this with graph search: treat tokens as nodes and exchange rates as edges, take the logarithm of each rate, and look for cycles whose total is positive. The method is described in general terms in standard references on arbitrage, such as the Investopedia entry on triangular arbitrage.
In practice, filters are essential:
- Drop pools with too little liquidity for a meaningful size.
- Drop tokens with transfer fees or suspicious contracts.
- Compute the optimal size per loop, because impact on three pools compounds.
- Subtract fees and gas at a conservative price.
- Re-simulate against the latest block before sending.
Where it fits among other strategies
Triangular loops are one tool among several. Two-pool arbitrage, covered in how DEX arbitrage works, needs smaller gaps because it pays only two fees. Cross-venue arbitrage between an exchange and a pool is covered in CEX versus DEX arbitrage. Triangular loops are interesting because they do not need inventory on two venues, but they are not necessarily easier or more profitable.
For a sense of how a product vendor describes this scope, CryptoMEV Bot’s DeFi arbitrage bot page is a good comparison point alongside the Ethereum-specific page. We do not claim either bot finds profitable loops, and neither page gives performance data. What a bot can offer is breadth of search and fast, simulated execution, and your test results should tell you whether it earns more than it costs.
The reverse direction and why both matter
Every triangle can be traded two ways. If the clockwise loop returns less than you started with, the anticlockwise loop might return more, because it uses the same three prices inverted. A scanner should evaluate both directions and report whichever is better, after fees. On a centralised exchange this is cheap to compute. On-chain, each direction may use different pools with different fee tiers, so the two directions are genuinely different trades with different costs.
There is also the question of the starting asset. A loop that starts and ends in ETH is evaluated in ETH, and one that starts and ends in a stablecoin is evaluated in dollars. The same three-token cycle can therefore be viewed from several starting points, and the start matters for gas accounting, because you pay gas in ETH regardless. Many bots start and end in ETH or a major stablecoin for exactly that reason.
Finally, consider the size limits. The maximum size is set by the shallowest of the three pools along the route. A loop with two deep pools and one thin pool is only as large as the thin one allows, and price impact on the thin pool can erase the profit well before the other two are stressed. This is why simply spotting a mispricing is not the same as being able to monetise it, and why simulation against live reserves is the decisive step. The vendor-side description of this scanning-and-simulation workflow appears on CryptoMEV Bot’s Ethereum arbitrage bot page, which lists real-time market analysis and pre-trade simulation among its features.
Common mistakes
- Ignoring the third fee when copying a two-leg calculator.
- Using quotes from different blocks.
- Assuming the first leg’s rate holds at larger size.
- Trading tokens with hidden transfer taxes, which turn apparent gains into losses.
- Forgetting that failed on-chain attempts still cost gas.
Summary
Triangular arbitrage exploits inconsistent prices among three assets. It avoids transfers between venues but pays three fees, so it needs larger mispricings to break even. On Ethereum it can be atomic, which helps, but gas and competition decide the outcome. All numbers here are illustrative, and this is not financial advice.
Frequently asked questions
What is triangular arbitrage in crypto?
Trading through three assets in a loop, for example A to B to C and back to A, to end with more A than you started with because the three prices are inconsistent.
Is triangular arbitrage risk-free?
No. Prices move during execution on centralised exchanges, and on-chain it costs gas and can be outbid or revert.
Does triangular arbitrage work on DEXs?
It can, because a single Ethereum transaction can run all three swaps atomically, but fees on three legs make the required gap larger.
How many fees does a triangular trade pay?
One per leg, so three trading fees on an exchange or three pool fees on a DEX, plus gas on-chain.
Sources
- Uniswap Docs – Fees – https://docs.uniswap.org/concepts/protocol/fees
- Investopedia – Triangular Arbitrage – https://www.investopedia.com/terms/t/triangulararbitrage.asp