FundamentalsBeginner

How DEX Aggregators Work: Finding the Best Swap Rate

Why one trade can get a better rate split across pools, how aggregators search liquidity, and how ChainBridge compares them to pick the best net amount.

ChainBridge ResearchUpdated 4 min read

On this page5 sections

Key takeaways

  • Liquidity for the same pair is spread across many pools and market makers; no single DEX has the best price for every trade.
  • Aggregators search those sources, split large orders and add hops when that returns more tokens, then settle everything in one transaction.
  • Splitting works because price impact grows with trade size: two half-size trades in two pools lose less than one trade in one pool.
  • ChainBridge asks 0x, KyberSwap and ParaSwap in parallel and picks the quote with the highest net amount after fees and gas.

What is a DEX aggregator?

A DEX aggregator finds the best way to execute your swap across many exchanges. Instead of checking Uniswap, Curve, PancakeSwap and dozens of other venues one by one, you ask the aggregator once. It returns a route and a ready-to-sign transaction.

Think of a flight comparison site: it does not fly planes, it searches airlines. An aggregator holds no liquidity either. It stays non-custodial: your tokens leave your wallet only inside the swap transaction you sign, and the output comes back in that same transaction.

Why one DEX is not enough

Each exchange has its own pools, fee tiers and pricing curve. The same pair may trade in a 0.05% pool and a 0.3% pool on one DEX, a stable pool on another, and through professional market makers off-chain. Arbitrage bots narrow the gaps, but prices are never perfectly aligned.

The best route is not always direct either. Swapping a small token for USDC may be cheaper through ETH if the direct pool is thin. What the aggregator usually finds, by trade type:

What usually wins, by trade type
TradeTypical best routeWhy
Small trade on a major pairUsually one pool or one market maker wins outright.Splitting costs extra gas, which outweighs the tiny price impact.
Large trade on a major pairOften split across several pools, or filled by a market maker.Price impact on a single pool grows fast with size.
Long-tail tokenMulti-hop route, for example TOKEN to ETH to USDC.A direct pool may be thin or missing; the detour is cheaper.
Stablecoin to stablecoinSpecialized stable pools with very low impact.Pools designed for pegged assets keep the price flat over a wide range.

How order splitting works

In a constant-product pool, every token you take out makes the next one more expensive. Price impact rises roughly in line with your trade size relative to pool depth, so cutting the trade in half across two pools roughly halves the impact on each.

One poolSell 20 ETH20 ETHPool A1,000 ETH2.4M USDC47,059 USDC2.0% below spotSplit across two poolsSell 20 ETH10 ETH10 ETHPool A1,000 ETH2.4M USDCPool B1,000 ETH2.4M USDC47,525 USDC1.0% below spot
Example with two identical pools of 1,000 ETH and 2.4M USDC (spot 2,400). Splitting 20 ETH returns about 466 USDC more.

Real routes are rarely that symmetric. Aggregators weigh pools of different depths and fees, and they stop splitting once each extra leg costs more gas than it saves. On small trades a single pool almost always wins.

Price impact is not the same as slippage: impact is the cost of your own trade and is already in the quote; slippage is how much the price moves before your transaction lands. See Slippage explained, which includes an interactive chart of price impact by trade size.

How ChainBridge compares aggregators

ChainBridge does not search pools itself. It sends your request to three aggregators in parallel, 0x, KyberSwap and ParaSwap, each of which does its own pool search and splitting. On eligible pairs it also asks 0x for a gasless quote. Then it compares the answers on what actually reaches your wallet.

Your request1 ETH to USDCChainBridgeranks by net0x2,397.10 − gas 1.20 = 2,395.90 USDCKyberSwapBest net2,396.80 − gas 0.40 = 2,396.40 USDCParaSwap2,397.30 − gas 1.60 = 2,395.70 USDC
Example quotes for 1 ETH to USDC on Ethereum. The highest output is not always the best deal once gas is counted.

Ranked by net amount

Each quote is scored on the tokens you receive after fees, minus the gas cost of executing it. A route with a slightly better rate but a heavier transaction can lose.

Same fee everywhere

The platform fee is applied the same way to every fee-collecting source, so it never tilts the ranking. If a fee-less source still wins on net, it is selected.

Resilient to outages

Quotes are requested in parallel with a timeout. If one aggregator is slow or fails, the comparison goes ahead with the others.

Checked before you sign

The winning transaction is simulated, its target contract is matched against an allowlist and the tokens are screened for honeypots and high sell taxes.

The architecture is covered in more depth in Smart order routing, and the aggregators themselves in DEX aggregator comparison.

Aggregator or direct DEX?

Use an aggregator when

  • The trade is big enough for price impact to matter
  • Liquidity for the pair is spread across several venues
  • You want the best price without checking every DEX by hand

A single DEX can be enough when

  • The token only trades in one pool, such as a brand-new launch
  • You need a feature specific to that venue
  • You want to provide liquidity: aggregators only swap

Put it into practice

Compare 0x, KyberSwap and ParaSwap in one quote, with every route checked before you sign.

Start swapping