Skip to content

Swaps and pools

Trading against a pool instead of a person.

5 minChecked 4 October 20264 sources

Animation is off, so this lesson is a plain page: one still picture and a few sentences for each step. Turn animation on in the menu to watch it play.

10 ETHIn the pool
20,000 USDCIn the pool
Example numbers with a 0.30% pool fee, not live prices.

Step 1 of 5

A pool of two tokens

On a decentralised exchange, a pool holds two tokens supplied by other people: here, 10 ETH and 20,000 USDC.

  1. 10 ETHIn the pool
    20,000 USDCIn the pool

    Step 1 of 5

    A pool of two tokens

    On a decentralised exchange, a pool holds two tokens supplied by other people: here, 10 ETH and 20,000 USDC.

  2. 9.5252 ETHIn the pool
    21,000 USDCIn the pool
    You

    Step 2 of 5

    You swap against the pool

    To swap, you put one token in and take the other out. Nobody has to be on the other side: a program on the blockchain does the trade.

  3. 9.5252 ETHIn the pool
    21,000 USDCIn the pool
    You
    The pool's ruleBefore10 × 20,000 = 200,000After9.5252 × 21,000= 200,029
    The small extra is the feeKept by the pool

    Step 3 of 5

    The pool's rule

    The pool keeps its two balances, multiplied together, the same before fees. This constant-product rule is how Uniswap's original (v2) pools set the price.

  4. 9.5252 ETHIn the pool
    21,000 USDCIn the pool
    You
    The pool's ruleBefore10 × 20,000 = 200,000After9.5252 × 21,000= 200,029
    You receive 0.4748 ETHAt the starting price: 0.5000 ETH
    The pool's price moved2,000 to about 2,205 USDC per ETH
    In a pool 100 times largerThe same swap returns 0.4983 ETH

    Step 4 of 5

    Bigger swaps, worse prices

    Put in 1,000 USDC with a 0.30% fee and you get 0.4748 ETH, not the 0.5 that the starting price suggests. The bigger the swap compared with the pool, the worse the price. Try it below.

    Try it

    You get 0.4748 ETH. At the starting price it would be 0.5000 ETH, so you lose 5.0% to price impact and the fee.

  5. 9.5252 ETHIn the pool
    21,000 USDCIn the pool
    You
    Sandwich attacksAbout $60 million on Ethereum, year to Oct 2025
    Set a slippage limit

    Step 5 of 5

    What can go wrong

    Others can see your swap before it is final and trade around it. These sandwich attacks cost traders on Ethereum about $60 million in the year to October 2025. A slippage limit caps how bad a price you accept.

Example numbers with a 0.30% pool fee, not live prices.

Quick check

Did it stick?

2 questions. Get them right to complete the lesson.

Question 1

Question 1 of 2

Who is on the other side of a pool swap?

Question 2

Question 2 of 2

What happens to your price as your swap gets bigger?

Or skip ahead to lesson 8: Staking.

Sources

Checked 4 October 2026
  1. Uniswap v2 Core whitepaperUniswap
    • On a decentralised exchange, a pool holds two tokens supplied by other people.
    • You swap against the pool, and a program on the blockchain does the trade.
    • The pool keeps its two balances, multiplied together, from falling; before fees the product stays the same.
    • This constant-product rule is how Uniswap's original (v2) pools set the price.
    • Put 1,000 USDC with a 0.30% fee into a pool of 10 ETH and 20,000 USDC and you get 0.4748 ETH, not 0.5 (arithmetic from the whitepaper's rule).
    • The bigger the swap compared with the pool, the worse the price.
  2. Maximal Extractable Value: implications for crypto marketsEuropean Securities and Markets Authority
    • Others can see your swap before it is final and trade around it (a sandwich attack).
  3. Exclusive data from EigenPhi reveals that sandwich attacks on Ethereum have wanedCointelegraph Research
    • Sandwich attacks cost traders on Ethereum about $60 million in the year to October 2025.
  4. Uniswap v2 pricingUniswap documentation
    • A slippage limit caps how bad a price you accept.

Corrections to this lesson: none so far. Spotted something wrong? See how we check facts on the sources page.