Skip to main content
T TON Adoption
← Glossary
NODE/03 · Term

DEX aggregator

A service that pools liquidity from multiple DEXs and routes a user's swap across the best combination of venues to minimise slippage and maximise output.

Aliases: liquidity aggregator, swap aggregator

DEX aggregator is a swap router that sits on top of several decentralised exchanges. Instead of executing a trade on a single pool, it splits the order across pools and protocols to give the user the best effective price after fees and slippage.

How it differs from a regular DEX

A regular DEX such as STON.fi or DeDust is a single protocol with its own pools. Large swaps push the price inside one pool, and slippage eats into the output. An aggregator looks at the live state of every connected DEX and builds a route: for example, 60% of the order through STON.fi on the TON/USDT pair, 25% via DeDust through TON/jUSDT then USDT/jUSDT, and the remaining 15% through a third pool. The blended price beats any single source.

How routing works

The typical algorithm:

  1. Take an order: swap amount X of token A for token B.
  2. Pull on-chain state from every supported DEX — reserves, fees, weights.
  3. Solve an optimisation problem: how to split the input across routes to maximise output.
  4. Account for:
    • per-DEX swap fees, usually around 0.2–0.3%;
    • gas for extra hops (cheap on TON, but still counted);
    • depth-dependent slippage in each pool.
  5. Return a ready-to-sign transaction to the frontend — on TON, a sequence of jetton messages targeting the router contract.

The more DEXs the aggregator covers and the deeper their pools, the stronger the effect. For sizable trades the gap versus a single DEX easily reaches several percent.

Aggregators and swap routers in TON

In TON the line between a DEX and an aggregator is fuzzy. Wallets and front-ends have shipped their own swap routers that look across multiple sources:

  • Tonkeeper swap — built into the wallet, routes across STON.fi and DeDust under the hood.
  • MyTonWallet swap — similar, aggregates liquidity across several DEXs.
  • Wallet in Telegram — embedded swap that hides the underlying venue from the user.
  • Megaton Finance — positioned as a cross-chain aggregator with TON support.
  • GeckoTerminal — external dashboard for pools and routing data, more analytics than execution.

When to use an aggregator

  • The trade size is meaningful relative to pool depth (rule of thumb: more than one percent of the target pool’s reserves).
  • The pair is exotic and there is no direct A to B pool, so a path via TON or USDT is needed.
  • You want to skip manually comparing quotes on multiple interfaces.

For tiny swaps of a few dollars the savings disappear into fees, and going to a specific DEX directly is fine.

What an aggregator does and does not do

An aggregator does not create liquidity, it just uses what exists efficiently. If the network has thin liquidity for a given pair, slippage will still be noticeable, just smaller than without routing. Always compare the aggregator’s quote endpoint against the input size you actually plan to trade, not the headline mid-price on a dashboard, which ignores your volume.

Related terms