How routing works on Uniswap
When you swap tokens on Uniswap, the app automatically searches for a favorable price for your trade. This is handled by a system called the Auto Router — an algorithm that works behind the scenes every time you swap.
What is routing?
Every swap on Uniswap moves your tokens through one or more liquidity pools. A route is the path your swap takes to get from token A to token B.
The simplest route is a direct swap, such as ETH → USDC through a single pool. But sometimes a better price is available by going through intermediate tokens, such as ETH → WBTC → USDC. The Auto Router evaluates these possibilities and picks a route based on how many output tokens you'd receive after accounting for fees and network costs.
The Auto Router uses an advanced smart order routing algorithm to route to the best price for the swapper.
When default trade options are turned on, Uniswap will select the most efficient trade route considering price, liquidity, and network costs.
The auto-routing algorithm includes:
- Split routes that execute swaps across multiple pools at once
- A more powerful algorithm that considers a larger data set
- Network cost awareness that ensures every added step is net positive for the trade
How the Auto Router works
-
Split routes: Rather than sending your entire trade through one pool, the Auto Router can split it across multiple paths simultaneously. This is useful when no single pool has enough liquidity to absorb a large trade without moving the price against you.
-
Searching more deeply: The Auto Router examines a larger set of pools and token paths than a standard router would. This matters especially on large trades, where routing through one or two pools can cause significant price impact. By exploring more of the available liquidity, the Auto Router can find execution paths that reduce that impact.
- Network cost awareness: Adding more hops to a route increases the network cost. The Auto Router factors this in — it only adds an extra step if the price improvement outweighs the additional cost you'd pay. For smaller trades, this often means taking a simpler, shorter route that costs less to execute.
Liquidity across versions
The Auto Router considers liquidity across Uniswap v2, v3, and v4. If one offers a more favorable effective price after accounting for gas, the router will use it automatically. You don't need to think about which version to use — the router handles this for you.
Viewing your route
After entering a swap in the Uniswap app, you can hover over the route icon to see exactly how your trade will be executed — which pools it will pass through and how the trade is split (if applicable).
Changing default trade options
If you would like to adjust your trade options, see our article here: How to change default trade options.