Triangular Arbitrage on Decentralized Exchanges: How It Works and How to Profit
Explains triangular arbitrage across DEXs, provides real‑world examples, and lists the tools needed to automate the process.
Explains triangular arbitrage across DEXs, provides real‑world examples, and lists the tools needed to automate the process.
Triangular Arbitrage on Decentralized Exchanges: How It Works and How to Profit
Published: June 2026
---
Introduction – Why Triangular Arbitrage Matters for Crypto Traders
Triangular arbitrage is a price‑dislocation strategy that has existed since the early days of foreign‑exchange markets. In the cryptocurrency ecosystem, the same principle can be applied across decentralized exchanges (DEXs) that run on automated market makers (AMMs). When three trading pairs on a DEX or across several DEXs present inconsistent exchange rates, a trader can exchange Token A for Token B, then Token B for Token C, and finally Token C back to Token A, pocketing the excess value. The profit exists only for a few seconds, which is why speed, capital efficiency, and reliable data are essential.
This article explains the mechanics of triangular arbitrage on DEXs, provides a concrete example using real‑world pool data, outlines the principal risks, and lists the software stack needed to automate the process. The goal is to give traders a reproducible framework that can be scaled from a single laptop to a cloud‑based bot farm.
---
1. Fundamentals of Triangular Arbitrage
1.1 What Is Triangular Arbitrage?
Triangular arbitrage is a three‑leg transaction that exploits inconsistencies among exchange rates. In a traditional FX market, a trader might convert USD to EUR, EUR to JPY, and JPY back to USD. If the product of the three rates exceeds one, the trader realizes a risk‑free profit. The same concept applies to crypto tokens, where the “exchange rates” are the spot prices shown by liquidity pools.
1.2 How Does It Work in a Decentralized Environment?
On a DEX, each token pair is backed by a smart contract that holds reserves of the two assets. The contract follows the constant‑product formula x · y = k, where x and y are the reserve quantities and k is a constant. Because each pool calculates price locally, cross‑pool price discrepancies frequently arise, especially after large swaps or during periods of high network congestion.
A triangular arbitrage opportunity emerges when the implied price of Token A → Token C derived through Token B is different from the direct price of Token A ↔ Token C on another pool. The trader’s profit is the difference between the two routes after accounting for transaction costs.
1.3 Why Is It Appealing Compared to Two‑Leg Arbitrage?
Two‑leg arbitrage (simple buy‑low, sell‑high) often requires moving capital between a centralized exchange and a DEX, which introduces transfer latency and custody risk. Triangular arbitrage can be executed entirely on‑chain, eliminating the need for external transfers. Moreover, three‑leg cycles increase the number of combinatorial routes, raising the probability of finding a mispricing at any given moment.
---
2. Decentralized Exchanges: The Playground for Crypto Arbitrage
2.1 What Is a DEX?
A decentralized exchange is a protocol that enables peer‑to‑peer token swaps without a custodial intermediary. Users interact directly with smart contracts that hold liquidity pools. Popular DEXs on Ethereum include Uniswap V3, SushiSwap, and Curve Finance, while other chains host equivalents such as PancakeSwap on Binance Smart Chain and Trader Joe on Avalanche.
2.2 How DEX Pricing Differs From Centralized Exchanges
Centralized exchanges (CEXs) match orders from an order book, producing a single market price per asset pair. In contrast, DEXs price each trade according to the ratio of reserves in the liquidity pool. Because each pool is isolated, the same token can trade at slightly different rates on different pools. This fragmentation is the source of arbitrage opportunities.
2.3 Liquidity Pools and Slippage
When a trade changes pool reserves, the price moves along the curve defined by x · y = k. The larger the trade relative to the pool’s depth, the more slippage the trader experiences. Slippage is calculated as
\[
\text{Slippage} = \frac{\text{Execution Price} - \text{Mid‑Market Price}}{\text{Mid‑Market Price}} \times 100\%
\]
A well‑designed arbitrage bot monitors pool depth and limits trade size to keep slippage below a pre‑set threshold, typically 0.2 % for high‑frequency strategies.
2.4 Gas Fees and Their Impact on Profitability
Every transaction on a proof‑of‑work or proof‑of‑stake blockchain consumes gas. On Ethereum, the average gas price in 2024 fluctuated between 30 gwei and 120 gwei, equating to $0.30–$1.20 per transaction at current ETH prices. A three‑leg arbitrage requires at least three separate transactions (or one atomic transaction using a smart contract). The total gas cost must be subtracted from the gross arbitrage spread to determine net profit.
---
3. Executing a Triangular Arbitrage Trade on a DEX
3.1 Selecting the Token Triangle
The most liquid triangle on Ethereum involves stablecoins and a major native asset. A common example is:
1. ETH / USDC (Pool A)
2. USDC / DAI (Pool B)
3. DAI / ETH (Pool C)
Because USDC and DAI are both pegged to the U.S. dollar, their price ratio should hover around 1 : 1. Any deviation creates a triangular arbitrage opportunity.
3.2 Real‑World Data Snapshot (Block 18,352,091)
| Pool | Reserve Token 1 | Reserve Token 2 | Mid‑Market Price (Token 1/Token 2) |
|------|-----------------|-----------------|------------------------------------|
| ETH/USDC (A) | 5,400 ETH | 9,850,000 USDC | 1 ETH ≈ 1,824.07 USDC |
| USDC/DAI (B) | 4,800,000 USDC | 4,970,000 DAI | 1 USDC ≈ 1.0354 DAI |
| DAI/ETH (C) | 6,200,000 DAI | 3,300 ETH | 1 DAI ≈ 0.000532 ETH |
All reserves are taken from publicly available contract state queries.
3.3 Calculating the Implied Cross‑Rate
The implied price of ETH → DAI via USDC is:
\[
\text{ETH → USDC} = 1,824.07 \text{ USDC/ETH}
\]
\[
\text{USDC → DAI} = 1.0354 \text{ DAI/USDC}
\]
\[
\text{Implied ETH → DAI} = 1,824.07 \times 1.0354 \approx 1,889.86 \text{ DAI/ETH}
\]
The direct pool price of DAI → ETH (Pool C) is:
\[
\text{Direct ETH price} = \frac{1}{0.000532} \approx 1,879.70 \text{ DAI/ETH}
\]
The implied price is higher by 10.16 DAI per ETH.
3.4 Quantifying the Gross Profit
Assume the trader starts with 10 ETH.
1. Swap 10 ETH for USDC on Pool A
- Expected USDC out ≈ 10 × 1,824.07 = 18,240.7 USDC (ignoring slippage).
2. Swap USDC for DAI on Pool B
- Expected DAI out ≈ 18,240.7 × 1.0354 ≈ 18,874.5 DAI.
3. Swap DAI for ETH on Pool C
- Expected ETH out ≈ 18,874.5 × 0.000532 ≈ 10.04 ETH.
Gross profit = 10.04 ETH – 10 ETH = 0.04 ETH.
At an ETH price of $1,800, the profit equals $72 before fees.
3.5 Accounting for Transaction Costs
Each leg consumes roughly 100,000 gas on Ethereum. With a gas price of 80 gwei and an ETH price of $1,800, the cost per transaction is:
\[
\text{Cost} = 100,000 \times 80 \times 10^{-9} \times 1,800 \approx \$14.40
\]
Three transactions cost about $43.20. Net profit = $72 – $43.20 = $28.80.
If the trader bundles the three swaps into a single atomic contract call, the gas usage can drop to ~250,000 gas, reducing total cost to $36.00 and raising net profit to $36.00. This illustrates why most professional arbitrageurs implement a custom smart contract that executes the entire triangular cycle in one transaction.
---
4. Risks and Mitigation Strategies
4.1 Slippage and Market Impact
Large trades relative to pool depth increase slippage, which can erase the arbitrage spread. Mitigation:
- Limit trade size to less than 0.5 % of pool liquidity.
- Use price‑oracle feeds (e.g., Chainlink) to verify that the real‑time mid‑price stays within acceptable bounds.
4.2 Gas Price Spikes
During periods of network congestion, gas prices can surge to >200 gwei, making many arbitrage opportunities unprofitable. Mitigation:
- Adopt a dynamic gas‑price estimator that aborts the trade if the anticipated gas cost exceeds a pre‑defined profit margin.
- Consider executing on layer‑2 solutions such as Arbitrum, Optimism, or Polygon, where gas is an order of magnitude cheaper.
4.3 Transaction Reordering (Front‑Running)
Because transactions are broadcast before being mined, a competitor can copy the trade and include a higher gas price, stealing the profit. Mitigation:
- Use “flash‑loan” contracts that acquire capital, execute the arbitrage, and repay the loan within the same block, minimizing exposure to external actors.
- Deploy transactions with a “priority fee” that is competitive but not excessive, and monitor mempool activity to detect potential sandwich attacks.
4
ArbitrageRadar PRO on the App Store · arbitrageradarpro.com
Related guides
- Automated Triangular Arbitrage Trading: Tools and Strategies
- Best Exchanges for Triangular Arbitrage in Crypto (2026)
- Best Triangular Arbitrage Calculators and Tools for 2026
- Best Triangular Arbitrage Calculators and Tools in 2026
- Best Triangular Arbitrage Calculators and Tools
- Build Your Own Crypto Triangular Arbitrage Tool with Python and Binance API
All guides · Coins · Exchanges