Back to Blog

How Uniswap Routing Works: Why Your Swap Chooses One Pool Over Another

🤝Join the Beta

Help Us Build PoolShark

Get unlimited free access in exchange for feedback. We're figuring this out together and would love your help.

Join Beta

How Uniswap Routing Works: Why Your Swap Chooses One Pool Over Another

When you swap tokens on Uniswap, you're not just trading against a single pool—you're benefiting from a sophisticated routing algorithm that searches all possible paths to find you the best price. Understanding how this routing works reveals why some liquidity pools earn more fees than others and how to optimize your LP positions.

This guide breaks down exactly how Uniswap routing works, from the algorithm that finds optimal paths to why certain fee tiers capture more volume. You'll understand how liquidity depth influences routing decisions, why multi-hop routes often provide better prices, and how this affects both traders and liquidity providers.

By the end, you'll understand why your swap might route through three pools instead of one, and why this matters for maximizing LP returns.

What Is Uniswap Routing?

Routing is the process of finding the optimal path to execute your swap—determining which pools to use and in what order to get you the best price.

Simple example:

  • You want: ETH → LINK
  • Direct route: ETH/LINK pool (one swap)
  • Multi-hop route: ETH → USDC → LINK (two swaps)
  • Router chooses the path that gives you more LINK

Why routing matters:

  • Better prices for traders
  • More efficient use of liquidity
  • Determines which pools earn fees
  • Affects LP returns significantly

The Routing Problem: Finding the Best Path

The Challenge

Given:

  • You want to swap Token A for Token B
  • Multiple pools exist (direct and indirect)
  • Each pool has different liquidity depth
  • Each pool has different fees
  • Gas costs vary by route complexity

Goal: Find the path that gives you the most Token B after accounting for:

  • Pool fees
  • Slippage/price impact
  • Gas costs
  • Liquidity depth

This is computationally complex—with thousands of tokens and pools, there are millions of possible paths.

How Uniswap Solves It

Uniswap's router algorithm:

  1. Discovers all possible paths between tokens
  2. Calculates output for each path
  3. Accounts for fees (0.01% to 1% per hop)
  4. Estimates slippage based on liquidity depth
  5. Considers gas costs for multi-hop routes
  6. Selects optimal path (best net output)

Result: You get the best available price automatically, without manual route finding.

Direct Routes vs Multi-Hop Routes

Direct Route

What it is: Trading directly between two tokens in a single pool

Example:

  • Want: ETH → LINK
  • Route: ETH/LINK pool
  • One swap, one fee

Advantages:

  • Simple
  • Lower gas (one transaction)
  • Faster execution

Disadvantages:

  • Might not have best price
  • Limited by single pool's liquidity
  • Higher slippage if pool is small

Multi-Hop Route

What it is: Trading through intermediate tokens to reach destination

Example:

  • Want: ETH → LINK
  • Route: ETH → USDC → LINK
  • Two swaps, two fees

Advantages:

  • Often better prices (uses deeper pools)
  • Can access liquidity across multiple pools
  • Better execution for exotic pairs

Disadvantages:

  • Higher gas (multiple transactions)
  • More complex
  • Slightly slower

Router automatically chooses based on net output (output minus fees and gas).

Real Example: How Routing Works

Scenario: You Want to Swap ETH for LINK

Available pools:

  • ETH/LINK: $5 million TVL, 0.30% fee
  • ETH/USDC: $100 million TVL, 0.05% fee
  • USDC/LINK: $15 million TVL, 0.30% fee

Your trade: 1 ETH (worth ~$2,500)

Route 1: Direct (ETH → LINK)

Path: ETH/LINK pool

Calculation:

  • Input: 1 ETH
  • Pool fee: 0.30%
  • Price impact: 2% (small pool)
  • Output: ~450 LINK
  • Gas: $15

Net output: ~450 LINK

Route 2: Multi-Hop (ETH → USDC → LINK)

Path: ETH/USDC pool → USDC/LINK pool

Step 1: ETH → USDC

  • Input: 1 ETH
  • Pool fee: 0.05%
  • Price impact: 0.1% (large pool)
  • Output: ~2,498 USDC
  • Gas: $8

Step 2: USDC → LINK

  • Input: 2,498 USDC
  • Pool fee: 0.30%
  • Price impact: 0.5% (medium pool)
  • Output: ~460 LINK
  • Gas: $8

Total gas: $16 Net output: ~460 LINK

Router Decision

Comparison:

  • Direct route: 450 LINK, $15 gas
  • Multi-hop route: 460 LINK, $16 gas
  • Difference: +10 LINK, +$1 gas

Router chooses multi-hop because 10 extra LINK is worth more than $1 extra gas.

Key insight: Even with two fees and higher gas, multi-hop often wins because it uses deeper pools with better prices.

How Fee Tiers Affect Routing

The Fee Tier Hierarchy

Uniswap V3 has four fee tiers:

  • 0.01%: Stablecoins
  • 0.05%: Blue chips
  • 0.30%: Mid-caps
  • 1.00%: Exotic pairs

Router behavior: Prefers lower fees when liquidity depth is comparable.

Example: ETH/USDC Routing

Available pools:

  • ETH/USDC (0.05% tier): $100 million TVL
  • ETH/USDC (0.30% tier): $8 million TVL
  • ETH/USDC (1.00% tier): $500,000 TVL

Your trade: Swap $10,000 USDC for ETH

Router calculation:

0.05% tier:

  • Fee: $10,000 × 0.0005 = $5
  • Price impact: 0.01% (huge pool)
  • Output: ~3.996 ETH
  • Net: 3.996 ETH

0.30% tier:

  • Fee: $10,000 × 0.003 = $30
  • Price impact: 0.1% (smaller pool)
  • Output: ~3.970 ETH
  • Net: 3.970 ETH

1.00% tier:

  • Fee: $10,000 × 0.01 = $100
  • Price impact: 0.5% (tiny pool)
  • Output: ~3.890 ETH
  • Net: 3.890 ETH

Router chooses 0.05% tier—lower fee + better liquidity = best execution.

Result: 0.05% tier captures 80-90% of volume, even though 0.30% and 1% tiers exist.

This is why fee tier analysis matters—volume distribution determines LP returns, not just fee percentage. Track your positions with PoolShark to see which fee tiers are actually earning the most.

Liquidity Depth and Routing Decisions

Why Depth Matters

Liquidity depth = how much liquidity is available at current price

Impact on routing:

  • Deeper pools = less slippage = better execution
  • Router prefers deeper pools (all else equal)
  • Deeper pools capture more volume

Example: Comparing Pool Depths

Pair: ETH/INJ

Pool A (0.05% tier):

  • TVL: $20 million
  • Liquidity at current price: $15 million
  • Price impact for $10K trade: 0.07%

Pool B (0.30% tier):

  • TVL: $12 million
  • Liquidity at current price: $10 million
  • Price impact for $10K trade: 0.1%

Router calculation:

  • Pool A: Lower fee (0.05% vs 0.30%) + better depth = chosen
  • Pool B: Higher fee + less depth = not chosen

Result: Pool A captures most volume despite lower fee percentage.

Key insight: Liquidity depth often matters more than fee percentage for routing decisions.

V3 Concentrated Liquidity Impact

V3 pools concentrate liquidity at specific price ranges:

Example:

  • V2 pool: $10 million spread across full range → ~$5 million effective depth
  • V3 pool: $5 million concentrated at current price → $5 million effective depth

Result: V3 pools can compete with larger V2 pools because their concentrated liquidity provides similar depth at current price.

Router behavior: Often routes through V3 pools because concentrated liquidity provides better execution despite lower total TVL.

Multi-Hop Routing: When and Why

When Multi-Hop Wins

Scenario 1: No Direct Pool

  • Token A and Token B have no direct pool
  • Must route through intermediate token
  • Example: New token only has ETH pool, need USDC → route through ETH

Scenario 2: Better Prices via Intermediate

  • Direct pool has low liquidity
  • Intermediate pools have high liquidity
  • Multi-hop provides better execution
  • Example: ETH/LINK small, but ETH/USDC and USDC/LINK are large

Scenario 3: Fee Optimization

  • Direct pool has high fee tier
  • Intermediate pools have lower fees
  • Lower total fees via multi-hop
  • Example: Direct 1% fee vs 0.05% + 0.30% = 0.35% total

Real Multi-Hop Example

You want: USDC → PEPE (meme coin)

Available routes:

Route 1: Direct

  • USDC/PEPE pool: $500K TVL, 1% fee
  • Output: 1,000,000 PEPE
  • Gas: $15

Route 2: Two-hop

  • USDC → ETH → PEPE
  • USDC/ETH: $100M TVL, 0.05% fee
  • ETH/PEPE: $2M TVL, 1% fee
  • Output: 1,050,000 PEPE
  • Gas: $20

Route 3: Three-hop

  • USDC → ETH → USDT → PEPE
  • USDC/ETH: $100M TVL, 0.05% fee
  • ETH/USDT: $80M TVL, 0.05% fee
  • USDT/PEPE: $1.5M TVL, 1% fee
  • Output: 1,045,000 PEPE
  • Gas: $25

Router chooses Route 2—best output (1,050,000 PEPE) despite higher gas.

Key insight: Router evaluates all paths and chooses optimal one, not just the simplest.

How Routing Affects Liquidity Providers

Volume Distribution

Routing determines which pools earn fees:

Example: ETH/INJ

Available pools:

  • 0.05% tier: $18M TVL, captures 25% of volume
  • 0.30% tier: $12M TVL, captures 70% of volume
  • 1.00% tier: $1M TVL, captures 5% of volume

Why 0.30% wins:

  • Better liquidity depth at current price
  • Router prefers it for most trades
  • Captures majority of volume

Impact on LPs:

  • 0.30% tier LPs earn most fees (despite lower fee %)
  • 0.05% tier LPs earn less (less volume)
  • 1% tier LPs earn least (minimal volume)

This is why analyzing volume distribution is crucial—the pool with highest fee % doesn't always earn the most. Start tracking with PoolShark to see which pools are actually generating fees.

Capital Efficiency

V3 concentrated liquidity affects routing:

Example:

  • V2 pool: $10M TVL, $5M effective depth
  • V3 pool: $3M TVL, $3M effective depth (concentrated)

Router behavior:

  • Both pools provide similar execution
  • Router may prefer V3 (better capital efficiency)
  • V3 pool captures volume despite lower TVL

Impact: V3 LPs can earn similar fees with less capital, improving returns.

Fee Tier Optimization

Understanding routing helps LPs:

Key insights:

  1. Volume distribution matters more than fee %
  2. Liquidity depth affects routing decisions
  3. Concentrated liquidity competes effectively
  4. Multi-hop routes use multiple pools

Action items for LPs:

  • Check which fee tier captures most volume
  • Provide liquidity where router actually routes
  • Optimize for depth, not just fee %
  • Monitor routing patterns over time

This requires data and tracking—manually analyzing routing patterns is impossible. Track your positions with PoolShark to see where volume is actually flowing.

Advanced Routing Concepts

Split Routing

What it is: Router splits large trades across multiple paths

Example:

  • You want to swap $1 million USDC for ETH
  • Router splits:
    • 60% through ETH/USDC (0.05% tier)
    • 30% through ETH/USDT → USDC
    • 10% through WBTC → ETH → USDC

Why: Minimizes price impact by distributing trade across multiple pools.

Benefit: Better execution for large trades.

Gas Optimization

Router considers gas costs:

Example:

  • Direct route: 450 tokens, $15 gas
  • Multi-hop: 460 tokens, $30 gas
  • Net: +10 tokens, -$15

If tokens worth <$1.50 each: Router chooses direct (gas costs more than extra tokens) If tokens worth >$1.50 each: Router chooses multi-hop (extra tokens worth more than gas)

Router optimizes: Net output after gas, not just gross output.

Slippage Protection

Router accounts for slippage:

Calculation:

  • Estimates price impact for each route
  • Accounts for slippage in output calculation
  • Chooses route with best net output after slippage

Example:

  • Route A: 100 tokens output, 1% slippage = 99 tokens net
  • Route B: 98 tokens output, 0.1% slippage = 97.9 tokens net
  • Router chooses Route A (better net output)

Why Some Pools Earn Less Than Expected

Common LP Confusion

LP expectation: "I'm in the 1% fee tier, I should earn more than 0.05% tier"

Reality: Router routes through 0.05% tier because it has better liquidity depth.

Result: 0.05% tier captures 80% of volume, 1% tier captures 5%.

Why LPs are disappointed:

  • Chose pool based on fee % alone
  • Didn't check volume distribution
  • Didn't understand routing behavior
  • Expected returns don't match reality

How to Avoid This

Before providing liquidity:

  1. Check volume distribution:

    • Which fee tier captures most volume?
    • Use analytics tools (Uniswap Analytics, GeckoTerminal)
  2. Analyze liquidity depth:

    • Compare TVL across tiers
    • Check effective liquidity at current price
    • Understand V3 concentration
  3. Consider routing patterns:

    • Where does router actually route?
    • Which pools get used in multi-hop routes?
    • How does liquidity depth affect routing?
  4. Track performance:

    • Monitor actual fee earnings
    • Compare to expectations
    • Adjust strategy based on data

This is exactly what PoolShark does—tracking where volume actually flows and showing you real fee earnings. Start tracking with PoolShark to see which pools are earning fees and which aren't.

Router Updates and Improvements

Historical Evolution

Uniswap V2:

  • Basic routing (direct pools only)
  • Simple path finding
  • Limited optimization

Uniswap V3:

  • Multi-hop routing
  • Fee tier consideration
  • Better path optimization
  • Gas cost accounting

Future (V4):

  • Even better routing
  • Lower gas costs
  • More sophisticated algorithms
  • Better execution

Continuous Improvement

Router updates:

  • Algorithm improvements
  • Better path finding
  • Gas optimization
  • Slippage reduction

Impact: Router gets better over time, improving execution for everyone.

Conclusion: Routing Determines LP Success

Understanding Uniswap routing reveals:

  • Why some pools earn more fees (router routes through them)
  • How liquidity depth affects returns (deeper pools get more volume)
  • Why fee tier selection matters (but volume distribution matters more)
  • How to optimize LP positions (provide liquidity where router routes)

Key takeaways:

  • Router finds optimal paths automatically
  • Multi-hop routes often provide better prices
  • Liquidity depth affects routing decisions
  • Fee tier % doesn't always determine volume
  • Tracking volume distribution is essential

For traders: Router automatically finds best execution—you don't need to think about it.

For liquidity providers: Understanding routing helps you:

  • Choose pools that actually earn fees
  • Optimize for volume distribution, not just fee %
  • Understand why some positions underperform
  • Make data-driven decisions

The difference between profitable and unprofitable LPs often comes down to understanding where volume actually flows—not where you think it should flow.

Ready to see where your liquidity is actually earning? Start tracking your positions with PoolShark to see which pools are generating fees, how routing affects your returns, and where to optimize—free for 7 days, no credit card required.


Want to learn more? Check out our guides on fee tier optimization, Volume-to-TVL analysis, or how Uniswap works. Get started with PoolShark to track routing patterns and optimize your positions.

🤝Join the Beta

Help Us Build PoolShark

Get unlimited free access in exchange for feedback. We're figuring this out together and would love your help.

Join Beta