How does routing work?

When you swap tokens on Uniswap, the app automatically searches for a favorable price for your trade. This is handled by Uniroute, 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 router evaluates these possibilities and picks a route based on how many output tokens you'd receive after accounting for fees and network costs.

Uniroute uses an advanced algorithm to route to the best price for the swapper.

When default trade options are turned on, Uniroute will select the most efficient trade route considering price, liquidity, and network costs.

The routing algorithm includes:

  • Split and multi-hop routes that execute swaps across multiple pools at once
  • Network cost awareness that ensures every added step is net positive for the trade
  • Simulation that validates the route and confirms it is effective


How Uniroute works

Split and multi-hop routes

Rather than sending your entire trade through one pool, Uniroute 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

Uniroute examines a large set of pools and token paths. 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 router can find execution paths that reduce that impact. The router doesn’t explore pools with fees greater than 11%. This protects swappers from unexpected price impact due to unusually high LP fees.

Network cost awareness

Adding more hops to a route increases the network cost. The router factors this in by only adding 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 router considers liquidity across Uniswap v2, v3, and v4. If one offers a more favorable effective price after accounting for network costs, 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.