Routing
Routing is the process of determining how an on-chain trade should travel through decentralised exchanges, liquidity pools, and aggregators to convert one token into another. The goal is usually to find efficient execution based on price, available liquidity, fees, and slippage.
✦ Key Insight
Liquidity in decentralised markets is fragmented. The same token may trade in many different pools across several DEXs. A direct swap is not always the cheapest or most efficient route. A routing system may discover that using several pools or an intermediate token produces a better result. Good routing can reduce price impact and increase the amount of output tokens received.
✕ Common Misconceptions
Assuming the shortest route is the cheapest
Looking only at headline token price
Ignoring network and pool fees
Assuming a quoted route is guaranteed to execute
Using untrusted routing services
Failing to inspect intermediate tokens
Detailed Explanation
How It Works
When a trader asks to swap one token for another, a routing engine searches available markets.
It may compare:
Token prices
Liquidity depth
Pool fees
Network fees
Price impact
Slippage
Available intermediate tokens
A simple route might be:
SOL → USDC
A more efficient route could be:
TOKEN A → SOL → USDC
More advanced aggregators can split a single trade across several pools.
For example:
50% through DEX A
30% through DEX B
20% through DEX C
The routing engine then constructs the transaction for the trader.
FAQs
Why does my swap sometimes use several exchanges?
The routing engine may split your trade to obtain better execution.
Can routing change between quote and execution?
Yes. Liquidity and prices change continuously.
Does a longer route always cost more?
No. Additional steps may still provide a better final price if liquidity is deeper.
In Practice
Dig Deeper
Slippage
Slippage is the difference between the price a trader expects when submitting an order and the actual price at which the trade executes. Slippage is common in crypto markets and is usually more noticeable during high volatility or when trading low-liquidity tokens.
Liquidity Pool
A liquidity pool is a collection of crypto assets locked in a smart contract that allows users to trade tokens on decentralized exchanges without relying on a traditional order book.
DEX Aggregator
A DEX aggregator is a protocol or service that sources liquidity from multiple decentralized exchanges and routes a user’s trade across the best available pools or paths to achieve optimal price and minimal slippage.
Trading Terminal
A trading terminal is an all-in-one interface that helps crypto traders discover, analyse, buy, sell, and monitor assets from one place. In on-chain trading, terminals often combine token discovery, charts, wallet data, order execution, portfolio tracking, and decentralised exchange routing. Some terminals are designed specifically for fast-moving markets such as newly launched tokens or meme coins.
