Triangular Arbitrage Explained: Profit From Price Cycles Between DEXs
Most arbitrage stories are about two venues quoting the same token differently. Triangular arbitrage is stranger and, in some ways, more elegant: you never leave the exchange, never compare it to another, and still come out ahead — because three tokens can price each other in a loop that doesn't quite add up. Here's how that cycle works, why so many of them are illusions, and why the whole thing has to succeed or fail as one atomic move.
The version of arbitrage everyone learns first is a straight line: buy a token cheap in one place, sell it dear in another, pocket the spread. But there's a second shape that lives entirely inside the connections between tokens, and it doesn't need a second venue at all. It needs three assets and a loop.
This is triangular arbitrage — profiting from a mispriced cycle rather than a mispriced pair. It's less intuitive than cross-venue arbitrage, harder to spot by eye, and riddled with false positives. It's also one of the cleanest illustrations of why a price on a decentralized exchange is not really a "price" at all, but a moving ratio you have to trade against. Let's walk through it.
What triangular arbitrage actually is
Triangular arbitrage means starting with one token, swapping through two others, and ending back where you began — A → B → C → A — with more of token A than you started with. No single leg has to be "wrong" for the loop to be profitable. What matters is whether the three exchange rates, multiplied together around the cycle, come out to more than one.
Think of it as three prices that are supposed to agree but don't. If the A/B rate, the B/C rate and the C/A rate were all perfectly consistent, going around the loop would return exactly what you put in (before fees). When they drift out of alignment — and on independent pools they constantly do — the round-trip returns slightly more or slightly less than one. When it returns more, that gap is the opportunity. When it returns less, the same loop run backwards is the opportunity.
The key mental shift is that you're not betting on any token going up or down. You start and end in the same asset within seconds. You're harvesting an internal inconsistency in how a set of pools price each other, not taking a market view.
A worked example with made-up numbers
Say you're holding USDC, and three pools on the same DEX quote the following (numbers invented for illustration):
- USDC → ETH: 1 ETH costs 2,000 USDC, so 2,000 USDC buys 1 ETH.
- ETH → WBTC: 1 WBTC costs 15 ETH, so 1 ETH buys 0.06667 WBTC.
- WBTC → USDC: 1 WBTC sells for 31,000 USDC.
Follow 2,000 USDC around the loop. First leg: 2,000 USDC → 1 ETH. Second leg: 1 ETH → 0.06667 WBTC. Third leg: 0.06667 WBTC → 0.06667 × 31,000 = 2,066.7 USDC. You started with 2,000 and ended with 2,066.7 — a gross gain of about 3.3%, without ever holding a directional position.
Where did that come from? Nobody set a "wrong" price on purpose. The WBTC/USDC pool simply valued Bitcoin a little richer, in USDC terms, than the chain of ETH-denominated rates implied. The three pools disagreed about the cross-rate between WBTC and USDC, and the loop turned that disagreement into 66.7 USDC. That is the entire game — in principle. In practice, almost none of that 3.3% is real, and the rest of this article is about why.
Why these cycles exist at all
Triangular gaps appear for the same structural reason cross-venue gaps do: there is no single price feed. On a decentralized exchange, each pool quotes a trade purely against its own reserves. The ETH/USDC pool has no idea what the WBTC/USDC pool is doing, and neither consults an oracle before answering. Each is an isolated little market that happens to share a token with its neighbors.
Because the pools are independent, anything that moves one without moving the others opens a cycle:
- Uneven order flow. A large USDC-for-ETH buy pushes the ETH/USDC pool but leaves the WBTC pools untouched, so the implied cross-rates fall out of sync.
- Different depths. A trade that barely nudges a deep pool can jolt a shallow one sharing the same token, tilting the loop.
- Lagging updates. Pools re-price only when someone trades them. Between trades, a pool can carry a stale rate that no longer matches its neighbors.
These forces never stop, which is why triangular opportunities are recurring rather than rare. The problem was never finding a cycle that looks positive — it's separating the ones that are genuinely positive from the overwhelming majority that only appear to be. This is a cousin of the cross-venue gaps we covered in cross-chain arbitrage, but here the whole loop lives inside one network's pools.
How you actually find a cycle
You don't find triangular arbitrage by staring at a price list — you find it by treating the market as a graph. Picture every token as a node and every pool as an edge connecting two of them, labeled with the exchange rate. A profitable cycle is a path that leaves a node and returns to it having multiplied to more than one along the way.
The classic trick is to take the logarithm of each rate and flip its sign. Multiplying rates around a loop becomes adding log-costs, and "the product exceeds one" becomes "the sum around the loop is negative." Now the question is exactly the one a well-known algorithm answers: is there a negative cycle in this graph? Bellman-Ford — in plain terms, a method that repeatedly relaxes every edge looking for a loop whose total cost keeps dropping — is the standard way to detect one. When it flags a negative cycle, it has found a sequence of swaps that, on paper, returns more than you put in.
One thing you must not do is ask an aggregator for the best A-to-A route. An aggregator's whole job is to price a swap at its true achievable rate, which means it already accounts for the impact that would close the cycle — so it will correctly tell you the round-trip nets to roughly zero. That's accurate, and it's exactly why it's useless here: the aggregator cancels the very edge you're hunting. To detect triangular arbitrage you have to look at the individual pool prices yourself and run the cycle search over them.
The phantom problem
Here is where detected opportunities go to die. The graph method above uses each pool's marginal price — the rate for a vanishingly small trade. That's the right input for detecting a cycle, but a disastrous one for estimating profit, because you are not going to trade a vanishingly small amount.
Every real swap moves the pool it touches. Buy ETH with USDC and you push the ETH/USDC pool against yourself; the more you buy, the worse the average rate. Do that on all three legs of the loop and the round-trip return is meaningfully lower than the product of the marginal rates suggested. A cycle that Bellman-Ford scores at +2% on marginal prices can collapse to zero — or negative — the moment you re-quote it for actual size. That's a phantom: an opportunity that exists in the marginal math and evaporates in the real round-trip.
Phantoms are not an edge case; they're the default. The overwhelming majority of "positive" cycles a naive scanner reports are phantoms produced by marginal prices overstating what a real trade would capture. Any serious triangular strategy spends most of its effort not on finding cycles but on disqualifying the fake ones — re-quoting the full chained round-trip at the size you'd actually trade, and throwing away everything that doesn't survive.
The costs that eat the edge
Even a cycle that survives price impact still has to clear its costs, and a three-legged trade stacks them up faster than a simple swap:
- Swap fees, three times. Every pool takes a cut on every leg. Three legs at 0.3% each is roughly 0.9% gone before slippage — enough to erase most small cycles on its own. Where cross-venue arbitrage pays two fees, triangular pays three.
- Slippage on every leg. The price impact that creates phantoms is also a hard cost on the cycles that are real. Each leg gives up a little to the pool, and the thinner the pool, the more it takes.
- Gas. The whole loop runs as one transaction, but it's a heavier one than a single swap, and on a busy network the gas alone can outweigh a thin edge.
The rule is the same as in any arbitrage: the only number worth acting on is the profit net of all three fees, net of real slippage, and net of gas. A headline +3.3% like our worked example routinely nets out to a fraction of a percent — or nothing. Judging a cycle by its gross figure is the fastest way to lose money doing this.
Why atomic execution matters
Now consider what happens if the three legs run as three separate transactions. You swap USDC into ETH. Between that and your next transaction, someone else trades the ETH/WBTC pool and the rate moves. You're now holding ETH, mid-cycle, with the opportunity gone — and to get back to USDC you have to sell at whatever the market now offers, possibly at a loss. You went looking for a risk-free loop and ended up with an unwanted directional position in the middle token.
The fix is atomic execution: bundle all three swaps into a single transaction that either completes in full or reverts in full. If the round-trip clears your minimum output, the whole loop settles at once and you're back in token A with a profit. If it doesn't — because a pool moved, or the edge was a phantom after all — the transaction reverts and you're left holding your original funds, out only the gas. There is no state where you're stranded halfway through, holding the middle token at a bad price.
Atomicity is what turns triangular arbitrage from a nerve-wracking three-step race into a single all-or-nothing action. It's the mechanism that lets you require "return at least X or don't trade at all," and have the blockchain enforce it for you.
Realistic expectations
It's worth being blunt about what this strategy is and isn't. Triangular arbitrage is not a stream of easy 3% wins. The deep, liquid pools where large size is possible are also the most heavily watched, so their cycles are tiny and short-lived. The wider cycles tend to live in thin pools, where price impact is brutal and you can only trade small amounts before you close the gap yourself. Three legs of fees set a real floor: a cycle has to clear roughly a percent of costs just to break even.
What's left, realistically, is a supply of small, genuine edges that appear and vanish constantly, captured in modest size and sized to the liquidity that's actually there. Done with discipline, that's a legitimate way to harvest market inefficiency without taking a directional view. Approached as a jackpot machine — acting on gross numbers, ignoring phantoms, oversizing thin pools — it's a reliable way to donate fees to liquidity providers. The same clear-eyed framing applies to letting software trade for you, which we cover in the AI trading agent article.
How AveraChain detects and executes it safely
AveraChain's protocol is built around exactly the discipline this strategy demands. Detection and execution are treated as two different problems, because they are:
- It detects on real pool prices. The scanner reads individual pool rates and runs negative-cycle detection over them — not an aggregator route, which would cancel the edge before you ever saw it.
- It re-quotes the real round-trip. Before anything executes, the full A → B → C → A chain is re-priced at real size, so phantoms produced by marginal math are filtered out. What survives is a net figure after all three fees, slippage and gas — not a flattering gross number.
- It auto-sizes to the pools. The trade is sized to the liquidity actually present in the shallowest leg, so you capture the edge without your own order erasing it.
- It executes atomically and non-custodially. The whole cycle runs as a single transaction from a vault only you control. It clears your minimum output or it reverts — you never get stranded holding the middle token, and the protocol never holds your keys.
You can watch how detection feeds execution across the rest of the protocol flow, where the same routing engine powers swaps, scheduled orders and cross-venue arbitrage. The point of all of it is the same: show you the number that's actually real, and let the chain enforce that you only trade when it is.
The bottom line
Triangular arbitrage is a small, honest edge wrapped in a lot of false ones. The cycle is real — three independent pools genuinely do price each other inconsistently — but the profit is almost always smaller than it first appears, buried under three fees, real slippage, and the phantom gap between marginal prices and actual round-trips. Detect it on real pool prices, re-quote the full loop at real size, and execute it atomically, and it becomes a disciplined way to harvest inefficiency. Skip any of those steps and it becomes a fee donation. See how AveraChain handles all three on the AveraChain home page.
Catch real cycles, not phantoms
AveraChain detects triangular arbitrage on real pool prices, re-quotes the full round-trip at real size, auto-sizes to the liquidity, and executes the whole cycle atomically from a vault only you control.
Explore AveraChain ↗FAQ
Is triangular arbitrage profitable?
It can be, but the honest answer is: less often than the numbers on a screen suggest. A cycle that looks like +2% on marginal pool prices is a gross figure. Once you subtract a swap fee on each of the three legs, the price impact of trading real size, and gas, most detected cycles land at or below zero. The profitable ones are usually small edges on reasonably deep pools, captured quickly and sized carefully. Treat triangular arbitrage as a disciplined way to harvest tiny, real inefficiencies — not a money printer.
Why do arbitrage opportunities disappear so fast?
Because a decentralized exchange price is just the ratio of a pool's reserves, and the moment anyone trades, that ratio moves. If a cycle is genuinely profitable, the first trader to complete it — you or someone else — pushes the pools back toward alignment and closes the gap. Add in bots watching the same pools and prices updating block by block, and a live cycle can vanish within seconds. That is why detecting an opportunity and re-quoting the real round-trip at the moment of execution matters far more than a stale scan.
What is a phantom arbitrage opportunity?
A phantom is a cycle that looks profitable on paper but is not real once you try to trade it. It usually comes from using each pool's marginal price — the rate for an infinitely small trade — to multiply the legs together. Real trades are not infinitely small: each leg moves its pool against you, so the round-trip returns less than the marginal math promised. A detected +2% can collapse to zero or negative the instant you re-quote it for actual size. Phantoms are the main reason naive arbitrage scanners lose money.
Is it risky — can I lose money mid-trade?
On AveraChain the cycle executes atomically: all three swaps happen in a single transaction that either completes as a whole or reverts as a whole. You never end up stranded holding the middle token after two legs at a worse price. If the round-trip would not clear your minimum output, the transaction simply reverts and you are left with your original funds, minus only network gas. The real risks are narrower — a thin pool, an edge too small to survive fees, or a cycle that closes before you execute — which is exactly why the protocol re-quotes and sizes the trade before committing.