Triangular Arbitrage
DEX & liquidity
Triangular arbitrage chains three swaps through three tokens and ends in the token it started with, for example SOL to USDC to JUP and back to SOL. If the three prices are out of line, the round trip returns more SOL than it started with, before fees. It differs from simple arbitrage because the gap is a cycle across three pools, not two prices for one pair.
Detailed explanation
Take three tokens and the pools that trade them. Swapping SOL for USDC, USDC for JUP and JUP back to SOL multiplies your balance by the three exchange rates. If their product is more than one, the cycle returns more than it started with. In efficient markets it is usually just under one.
Finding cycles is a graph problem. Treat each token as a node and each pool as an edge weighted by the negative logarithm of its price. A profitable cycle is a negative cycle in that graph, which standard algorithms can find. The bot re-scores only the edges whose pool state changed.
The hard part is the cost. Each leg pays a pool fee, and each leg moves its pool’s price by an amount that depends on the trade size, which is slippage. On concentrated-liquidity pools, that needs tick-level math to get right. On top of that come the priority fee and any tip.
The legs should go in one transaction, so that a price that has moved makes the whole route fail instead of leaving the bot holding a middle token. A bot simulates first, and only sends a route whose net, after every cost, clears the minimum you set. Many bots chase the same cycles, and none is guaranteed to pay.
When you'll see this
You see it in arbitrage bot design, in route-search code that scores cycles across Raydium, Orca and Meteora pools, and in transactions that contain three swaps ending in the token they began with.
How NoLimitNodes uses this
The triangular chapter of our arbitrage bot searches your token set for cycles, scores each after fees and tips, and sends all three legs in one transaction. Pool state comes from Yellowstone gRPC.
Related terms
- Flash Loan · A collateral-free loan borrowed and repaid inside one transaction. If it is not repaid, the transaction fails.
- Atomic Transaction · A transaction that completes in full or has no effect. If one instruction fails, every change is rolled back.
- CLMM · Concentrated Liquidity Market Maker. LPs choose a price range, and capital only earns fees inside that range.
- DLMM · Dynamic Liquidity Market Maker. Meteora’s discrete-bin model with zero slippage inside the active bin.
- Slippage · The gap between the price you quoted and the price you actually got, set as a tolerance on every swap instruction.