Lesson 2 of 7

DEXs and automated market makers

Step 3 of 6

Worked example

Uniswap v2 USDC/ETH pool, block 26,455,869, 20 Nov 2026, 11:00 UTC (read from the pool contract): 8,498,537.92 USDC and 4,851.4934 WETH (wrapped ETH). Pool price: 8,498,537.92 ÷ 4,851.4934 = $1,751.74.

k = 8,498,537.92 × 4,851.4934 ≈ 41,230,600,629.

A $10,000 trade, step by step.

  1. The 0.3% fee ($30) is held back, so $9,970 enters the formula.
  2. New USDC in the pool: 8,498,537.92 + 9,970 = 8,508,507.92.
  3. ETH the pool must keep: k ÷ 8,508,507.92 = 4,845.8086.
  4. ETH you receive: 4,851.4934 − 4,845.8086 = 5.6848.
  5. Average price: 10,000 ÷ 5.6848 = $1,759.07, 0.42% above the pool price: 0.30% fee plus about 0.12% price impact.

A $1,000,000 trade, same steps: $997,000 goes in and you get 509.39 ETH at an average of $1,963.13, 12.1% above the pool price. It leaves the pool's price at $2,187.54 until arbitrage traders (who buy where cheap and sell where dear) sell ETH back in.

A deeper pool. Same steps, ten times the balances (cost above pool price, fee included):

Trade This pool (about $17M) A pool 10× deeper
$10,000 +0.42% +0.31%
$1,000,000 +12.1% +1.48%

For big trades, depth matters far more than fee level.

Newer pools (Uniswap v3) let LPs place money in a chosen price range (concentrated liquidity), so they trade as if deeper near today's price.

An LP over the past year. Say $10,000 went into the v2 pool on 21 Nov 2025: half USDC, half ETH at $2,832.53 (CoinGecko). ETH at 10:58 UTC today: $1,756.02, so r = 0.620.

Hold the two tokens: 5,000 + 5,000 × 0.620 = $8,100
LP position:         10,000 × √0.620       = $7,874
IL = 7,874 ÷ 8,100 − 1 = −2.8%  (about $226)

Add fees: DefiLlama's yields API put this pool's fee yield at 5.39% a year (apyBase, 10:01 UTC, after Uniswap's protocol cut, Module 13 lesson 04). If that held all year, fees were about $539. LP plus fees ≈ $8,413: $313 better than holding, but $1,587 worse than keeping $10,000 in USDC, because ETH fell 38%.

A headline APY is not an LP's pay. It is the whole pool's recent fees ÷ its whole TVL, an average; the v3 0.05% pool showed 23.5%. A concentrated position earns more while the price stays in its range, nothing outside it, and suffers bigger IL. What pays for any pool's yield: impermanent loss, contract bugs (lesson 05), and the tokens themselves falling. Taxes reduce returns too.

These numbers move every block; the method is what you keep.