DEX Aggregator

A DEX aggregator searches many pools and exchanges and splits a swap across them to get a better overall price. A router contract is the smart contract that carries out the swap through the chosen path of pools.

Liquidity in DeFi is spread over many exchanges and pools. A DEX aggregator searches them and routes your swap to get the best overall price after fees and gas.

Category
Cryptocurrency and Blockchain
Reading time
3 min
Also called
Swap aggregator, Smart order router, Liquidity aggregator
Updated

A DEX aggregator in plain words

DEX aggregators query many trading protocols to find the best terms for a trade, including price, fee and slippage.1

They can split one trade across several protocols so the whole trade gets the best rate.1

Some even act as an aggregator of aggregators.1

How an aggregator routes a swap

  1. Enter the trade

    Choose tokens, amount and a slippage limit.

  2. Scan venues

    The aggregator queries many protocols for price, fees and slippage.1

  3. Split the order

    Large trades may be split across up to seven paths in one router's design.2

  4. Factor in gas

    Extra hops are added only if they improve the effective price.2

  5. Add fees

    Any aggregator fee is added to the fees of the underlying protocols.1

  6. Execute and check

    Sign, then compare the received amount with the quote.

Worked examples

Example 1 — Split beats single pool

+$3,000

Hypothetically you swap 100 ETH. Pool A alone gives an average $2,950; splitting 60/40 with pool B averages $2,980.

Example 1 — Split beats single pool — calculation
Single pool100 × $2,950 = $295,000
Split route100 × $2,980 = $298,000
Improvement$298,000 − $295,000 = $3,000

Splitting a trade across protocols aims to get the best rate in total.1

Example 2 — Gas eats a small trade

−$3, so skip the hop

Hypothetically a $500 swap gains $2 from an extra hop that costs $5 in gas.

Example 2 — Gas eats a small trade — calculation
Price gain+$2
Extra gas−$5
Net$2 − $5 = −$3

A router that counts gas only adds the extra hop when the better price still wins after fees.2

Example 3 — Aggregator fee

$45 in fees

Hypothetically a $10,000 swap, 0.3% pool fee, plus a 0.15% aggregator fee.

Example 3 — Aggregator fee — calculation
Pool fee$10,000 × 0.003 = $30
Aggregator fee$10,000 × 0.0015 = $15
Total$30 + $15 = $45

Aggregator fees are added on top of the protocols' own fees.1

DEX aggregator vs single DEX

AspectAggregatorSingle DEX
Liquidity sourcesMany protocolsOne
Order splittingYesWithin its own pools
Extra feeSometimesNo
Smart contract riskRouter plus venuesVenue only

Where aggregators help

Advantages and disadvantages

Advantages

  • Better prices on larger trades.
  • One interface for many venues.
  • Gas-aware routing for small trades.
  • Saves manual price comparison.

Disadvantages

  • Extra fee on some platforms.
  • More smart contracts involved.
  • Quotes can change before execution.
  • Approvals to router contracts add risk.

Going deeper

Read as far as you need. Each level builds on the one before it.

Shopping around for you

Beginner

Aggregators query many protocols to find the best price, fee and slippage.1

Price impact

Intermediate

Uniswap Labs reported a large stablecoin swap whose price impact could fall to as low as −0.749% with its router, showing how splitting helps size.2

Compliance angle

Advanced

The U.S. Treasury notes chain-hopping can be done through a DEX or aggregator, so rules on such services differ by country and are evolving.3

Common mistakes

  1. Loose slippage settings

    Allowing far worse fills than quoted.

  2. Ignoring gas

    Chasing a tiny price gain that costs more.

  3. Unlimited approvals

    Granting router contracts unlimited token access.

  4. Fake front-ends

    Using a phishing copy of an aggregator site.

Check your understanding

Test yourself before moving on. Each answer comes with an explanation.

Q1A route saves $12 in price but costs $8 more gas. Net?
Q2Can an aggregator split one trade across protocols?

Key points to remember

  1. Aggregators search many DEXs.
  2. They split trades for better rates.
  3. Gas is part of the calculation.
  4. Fees can stack.
  5. Extra contracts add risk.

Frequently asked questions

Is an aggregator always cheaper?

Not always; fees and gas can outweigh savings on small trades.

Does it hold my funds?

Usually not; it routes through smart contracts during the swap.

What is an aggregator of aggregators?

A service that compares several aggregators' quotes.

Further learning

Sources

This article is written in our own words. The sources below support the specific facts, rules and figures marked with a number in the text. Links open the original publisher’s page.

  1. IOSCO. Decentralized Finance Report (OR01/2022) (opens in a new tab) Checked .
  2. Uniswap Labs. Introducing the Auto Router (opens in a new tab) Checked .
  3. U.S. Department of the Treasury. Illicit Finance Risk Assessment of Decentralized Finance (2023) (opens in a new tab) Checked .

Educational content, not financial advice. Examples use hypothetical prices and simplified costs; actual fees, margin rules and regulations vary by broker, market and country. We are not affiliated with any publisher linked above. Last reviewed . Report an error or request a source credit.