← back to stream

AMM

An AMM (automated market maker) is the pricing formula a DEX uses to quote swaps against a liquidity pool, without an order book or discretionary market makers. The idea is radical in its simplicity: instead of matching bids and asks, you define an invariant that the pool's reserves must preserve, and the formula falls out.

Four flavours worth knowing:

  • Constant product (x * y = k) — Uniswap v2. Always has liquidity, always has price, but slippage grows with trade size. The default for volatile asset pairs.
  • Constant sum (x + y = k) — theoretical. Zero slippage near peg, but a single depegging trade drains the pool entirely.
  • StableSwap (Curve) — a hybrid that behaves like constant sum near the peg and constant product far from it. Minimal slippage for correlated assets (stablecoins, stETH/ETH), catastrophic capital efficiency for everything else.
  • Weighted pools (Balancer) — constant product generalised to arbitrary weights (e.g. 80/20), useful for index-like exposure.

The whole category is why DeFi trading works without professional market makers — the formula itself is the market maker.