DOCS / 01

What is a DEX aggregator?

A plain-language introduction: what a DEX and a liquidity pool are, why one pool is often not enough, what an aggregator does about it, how Tirio routes a swap step by step, and what it does not do.

Updated · Markdown version

A DEX (decentralized exchange) is a set of smart contracts that swaps tokens without an order desk or an account. Most DEXes on BNB Chain are AMMs (automated market makers): each trading pair lives in a liquidity pool, a contract that holds both tokens and prices a trade from how much of each it holds. When you buy from a pool, you add one token and take out the other, and the price moves against you as you go.

A DEX aggregator does not hold liquidity of its own. It reads the pools of many DEXes and builds one trade out of them.

Why one pool is often not enough

Every pool has limited depth. The more you trade against one pool, the more its price moves during your own trade. That loss is called price impact. Two other pools of the same pair, or a path through a third token, may each give a better price for part of your order.

An aggregator looks at those pools together and can:

  • Split your order across several pools, so that no single pool moves too far.
  • Route through other tokens (for example CAKE → WBNB → USDT) when the direct pair is shallow or missing.
  • Count gas: an extra pool is only worth it if it pays more than the gas it costs.

For a small trade in a deep pair, one pool is often already the best route, and the aggregator should return exactly that.

How Tirio routes a swap

  1. You choose the tokens and the amount on /swap or the trade page. While you type, Tirio returns an indicative price: a routed estimate that is not simulated and has no transaction yet.
  2. Tirio reads the pools for that pair: the pools between the chain's hub tokens (WBNB, USDT, USDC and others), the pools of your two tokens and, when a token is not a hub, the pools of the tokens it is most often traded against. It covers about sixty venues on BNB Chain.
  3. It searches for routes: paths of up to four swaps through hub and bridge tokens, then splits the amount across up to eight of them, using the same math the pools use and counting gas.
  4. When you press Review, it builds the quote you sign: the complete transaction, simulated on chain at the latest block. The simulated output and gas replace the estimate, and a route that fails in simulation is dropped and the order is routed again.
  5. You sign one transaction. It goes from your wallet to Tirio's Router, which runs the whole route and pays out in the same transaction. If you would receive less than your minimum received, the transaction reverts and only gas is spent.

The Router keeps no funds between transactions. The detailed version of these steps is in the Overview.

What it costs

  • 3 bps (0.03 %) of each swap on tirio.io, taken from the token you pay.
  • Positive slippage: on a sell of an exact amount of a token without transfer tax, if the swap delivers more than the quote, Tirio keeps the excess up to 1 % of the quoted output; anything above that reaches you.
  • Limit, stop and DCA orders: 10 bps of each fill, 3 bps between stablecoins.
  • Network gas and the pools' own fees, as when you trade on a DEX directly.

The full fee rules are in the Overview.

What the quote means

  • The quote is not a guarantee. The price can move between the quote and the block your transaction lands in; the minimum received is what you are guaranteed.

Swaps and orders

A swap fills now, at the market. An order waits for your terms: a limit order fills at your price or better, a stop-loss sells when the price falls to your stop, an optional take-profit sells when it rises to your target, and DCA buys or sells in equal slices on a schedule. Order tokens wait in the Orders contract until a keeper fills them, they expire or you cancel. See Orders.

Words used here

The Glossary explains slippage, price impact, MEV, permits, hub tokens and the other terms on these pages. How fast Tirio answers and how often it finds a route is measured on Benchmarks.