DEX routing: how a router picks a swap path
How DEX routing works: a router compares pool paths, then sends your swap through the route with the best output; extra hops can add gas and fees.
The Chainvane Desk4 min read

A DEX router finds a path through liquidity pools and sends your swap along the path expected to return the most tokens. It compares the available routes because no single pool holds the deepest liquidity for every token pair, and the best-priced route can involve an intermediate token.
Say you want to swap ETH for a small token on SyncSwap. The direct ETH-to-token pool is thin, so the router may send ETH to USDC through a Classic Pool, then trade that USDC for the token. Before approving a trade on SyncSwap, compare the route and estimated gas with the amount you expect to receive. A second hop can improve the quote, but it also adds cost.
Pool, path, hop and quote describe different parts of the route
A pool holds two tokens and lets traders exchange between them. Its reserves and pricing curve determine how much of one token a swap returns for the other. A path is the ordered sequence of pools between the token you sell and the token you want.
Each move from one pool to the next is a hop. A direct ETH-to-token trade uses one pool and one hop. The ETH-to-USDC-to-token route uses two pools and two hops. A quote estimates the output for a particular input amount along a candidate path.
On SyncSwap, Classic Pools use the constant-product formula x*y=k, while Stable Pools use a curve suited to pegged assets. That difference affects how each pool prices a trade as its reserves change. The router needs the pool type, reserves and fee to estimate what each candidate path would return.
The process starts with the input token, amount and desired output token. The router identifies paths that connect them, simulates the swap through each path, then selects the route with the best net output. It submits the selected route in one transaction. When signing, you set a minimum amount to receive; the transaction reverts if execution would return less than that minimum.
This route search is a familiar part of DEX trading. Uniswap's Smart Order Router documentation describes comparing routes to find a better trade output. The exact pools and route display depend on the DEX and the tokens involved.
More hops can improve the quote and raise the cost
Return to the ETH-to-small-token trade. If the direct pool has little liquidity, a trade can move its price sharply. The two-pool path through USDC may have deeper liquidity at both steps, so the router estimates more output even after accounting for both pool fees.
Each hop charges the fee for the pool it uses and changes that pool's price. A larger trade tends to have a bigger effect on reserves than a smaller one, so the output per token can worsen as the route executes. The router's quote reflects the pool state used for its estimate, while the actual result depends on conditions when the transaction is processed.
There is a second cost: gas. A multi-hop transaction has more pool interactions to execute, which can mean higher gas than a direct swap. That extra gas matters most when the trade is small. A route that returns slightly more tokens before gas may leave you with less value after paying for the transaction.
- Pool fees: Each pool in the route charges its own fee, so a two-hop path incurs fees at both steps.
- Price impact: Trading against a pool changes its reserves and price; thin liquidity can make that effect larger.
- Gas: Each additional hop adds work to the transaction, which can outweigh a small improvement in the quoted output.
Compare the quoted output and gas estimate together. Also read the route display: it shows which tokens and pools the trade passes through, and helps explain why the router chose that path. The highest token output alone may not be the best choice if the route costs more to execute.
Related
What is a multi-hop swap?
A multi-hop swap trades through at least one intermediate token. In the case above, ETH first becomes USDC, then USDC becomes the small token. The extra step can reach liquidity that a direct pair lacks, with added pool fees and gas as the trade-off.
What is price impact in a DEX swap?
Price impact is the change in a pool's price caused by the size of your trade relative to its liquidity. A large trade in a thin pool can shift the price more than a small trade in a deep pool. When you review a quote, compare the route, estimated output, minimum received and gas cost before deciding whether to swap.