‹ Understanding DeFi Lesson 5 of 16
Contents Lesson 5 of 16

5 min read · practitioner

How can a pool of tokens quote a price with no order book?

Every venue in the rest of this academy matches a buyer to a seller. An automated market maker does not. It has no bids, no asks, no queue and no counterparty waiting — just two piles of tokens and one line of algebra. Here is exactly how that produces a price.

The invariant

A constant-product automated market maker (AMM) holds reserves of two tokens, x and y, and enforces one rule on every trade:

x × y = k

The product of the reserves must not fall. Anyone may add either token and take out the other, provided the product still holds. That is the entire pricing engine.

The spot price of X in units of Y is simply the ratio of the reserves:

p = y / x

Nobody quotes it. It is a consequence of what is in the pool.

Worked: a small pool

A pool holds 10 ETH and 20,000 USDC.

k = 10 × 20,000 = 200,000 spot price = 20,000 ÷ 10 = 2,000 USDC per ETH

A trader wants to buy 1 ETH. The reserves must still multiply to 200,000, so:

new ETH reserve = 10 − 1 = 9 new USDC reserve = 200,000 ÷ 9 = 22,222.22

The trader must therefore put in 22,222.22 − 20,000 = 2,222.22 USDC for one ETH. Not 2,000. The average price paid is 2,222.22, which is 11.11% above the spot price the trade started from. The pool never promised the spot price; the spot price is only the price of an infinitesimally small trade.

The general result, in two lines

Buying Δx of token X out of reserves (x, y):

Δy paid = y · Δx / (x − Δx) and average price = y / (x − Δx)

Divide the average price by the spot price y/x and everything cancels:

price impact = Δx / (x − Δx)

That is the whole story of AMM pricing in one expression: what you take, divided by what is left. In the example, 1 ÷ 9 = 11.11% — exactly the figure above.

Worked: the same trade in a deep pool

Now a pool of 1,000 ETH and 2,000,000 USDC. Same spot price of 2,000; k = 2,000,000,000. Buy the same 1 ETH:

new ETH reserve = 999 new USDC reserve = 2,000,000,000 ÷ 999 = 2,002,002.00

Cost = 2,002.00 USDC. Price impact = 1 ÷ 999 = 0.10%.

Identical trade, identical starting price, a hundred-fold better execution — because depth, not quotation, is what an AMM sells. This is why "how deep is the pool relative to my trade" is the only liquidity question that matters here, and why it can be answered with a number rather than a feel for the market.

The arithmetic above is exact for a constant-product pool and wrong for most large pools today. Since Uniswap v3 (May 2021) liquidity providers place capital inside chosen price ranges, so depth at the current price can be many times what total reserves imply, and it vanishes at the edge of the range. Stableswap curves (Curve) are flatter still near the peg. A pool's reserves or TVL therefore no longer tell you its price impact; only the venue's quote for your size does, compared across venues at the same instant. The Δx / (x − Δx) rule still describes what happens once a trade exhausts the liquidity in range.

Where the fee goes, and why k drifts up

Real pools charge a fee — 0.30% is the classic tier — deducted from the input. Selling 1 ETH into the small pool:

effective input = 1 × 0.997 = 0.997 ETH

output = 20,000 × 0.997 ÷ (10 + 0.997) = 19,940 ÷ 10.997 = 1,813.22 USDC

Without the fee the output would have been 20,000 ÷ 11 = 1,818.18, so the fee cost the trader 4.96 USDC. But note what happens to the reserves: the whole 1 ETH stays in the pool while only 0.997 of it was used for pricing. New reserves are 11 ETH and 18,186.78 USDC, so:

new k = 11 × 18,186.78 = 200,054.6

k grew. It grows on every single trade, and that growth is the liquidity providers' income. It is the cleanest way to see what an LP actually owns: a share of a product that ratchets upward with volume — while the composition underneath it moves against them, which is the subject of lesson 3.

Who keeps the price honest

If the pool's ratio drifts away from the price elsewhere, the gap is an arbitrage: buy in the cheap venue, sell in the dear one, and the trade itself pushes the pool's reserves back. Arbitrageurs are not a bug in the design; they are the price-discovery mechanism. Nobody updates an AMM's quote. Someone profits from correcting it.

Try it now

  1. Both assets are below. Pick one date, read a close off each, and build a hypothetical pool holding $500,000 of each side at those prices. Compute k and the spot price the pool would quote.
Interactive line chart: ETH-USD.CC (1M)
Interactive line chart: BTC-USD.CC (1M)
  1. Using price impact = Δx / (x − Δx), work out the impact of a trade taking 1%, 5% and 20% of the ETH reserve. Note how fast the third one degrades — and that nothing about it depended on which two assets you chose.
  2. On a public DEX analytics site, find a real pool's reserves and 24-hour volume. Compute what fraction of the reserve an average trade represents. That ratio, not the protocol's name, is what determined the execution.