Crypto / Evergreen
A router chooses a path through available pools
A swap router can exchange assets through intermediate tokens or split execution across pools to seek a better result under its routing model.
Routing combines markets, so its quality depends on both exchange prices and the costs of traversing the chosen path.
The distinction that matters
A swap router can exchange assets through intermediate tokens or split execution across pools to seek a better result under its routing model. In an automated market maker, available reserves or active liquidity determine the quoted trade along a pricing curve. A router may choose among several pools or combine routes. The displayed quote is therefore a calculation about a particular path and state, not an unconditional offer from every possible counterparty.
How the mechanism works
The chosen path affects fees, gas usage, liquidity exposure, and the contracts that the transaction must call. Execution changes the state, and other transactions can change it before the user's transaction arrives. Several costs can appear in the same trade: pool fees, movement along the pricing curve, market changes before inclusion, and network execution charges. A minimum-output condition limits what the contract is allowed to deliver, while a deadline limits when the authorization remains usable. Neither guarantees execution.
A worked situation
Consider this hypothetical situation: A hypothetical direct pool is shallow, while a two-step route through a widely traded intermediate asset offers a better quoted output before gas. The route can improve exchange execution but adds another pool interaction and may consume more gas than the direct path.
Where interpretation can fail
The route with the highest gross output is not always the route with the best net outcome after execution costs and token-specific behavior. Inspect the actual path, pool fees, and estimated gas rather than treating the router's headline quote as a single uniform market. Routing combines markets, so its quality depends on both exchange prices and the costs of traversing the chosen path.
The wider technical implication
A route can depend on tokens with unusual transfer behavior or pools with different fee and callback logic. A grossly attractive path may therefore require more than arithmetic comparison: every integration assumption must hold. Routers can also use off-chain search to choose a path while on-chain contracts enforce the final bounds. The off-chain optimizer's claim of optimality is separate from the contract's guarantee that execution stays within the encoded limits. The most useful evidence is the realized path and net asset change, compared with the quoted assumptions at a clearly identified time.
A global perspective
Swap interfaces, pool access, token classification, and reporting obligations can differ by jurisdiction. Technical availability does not establish regulatory status.
Sources & further reading
Uniswap documentation — Swaps ↗Ethereum.org — Decentralized finance ↗Sources checked Oct 27, 2026. Educational examples. Historical observations are attributed to their sources. No affiliation with cited organizations.
Make the idea stick.
Mark complete when you are ready. Reaching the end alone does not mark a lesson complete.
What assumption in this guide would change the result in a different situation? Revisit the example and explain that change in your own words.
Explore crypto →