Liquidity pools: the AMM in five minutes
What a liquidity pool is
An exchange needs two things: buyers and sellers, and a way to agree on price. Traditional exchanges match them through order books - lists of bids and asks that market makers maintain. A liquidity pool does the matching without either: it holds reserves of two tokens, applies a formula to them, and lets anyone trade against the reserves at the formula's price. The pool is the market. Anyone can deposit tokens into it, anyone can trade against it, and the formula - not a queue of orders - decides every execution price. The design removed the market maker as a required participant and replaced them with mathematics and capital.
The constant-product mechanic
- The reserves and the invariant: a pool holds reserves of two tokens - say x of one and y of the other - and the classic invariant is x times y equal to a constant k. Every trade changes one reserve and the other moves to keep the product constant, and the price of each token is the ratio of the reserves: one token's price in the other is y divided by x.
- Why the formula prices trades: buying token X means adding X's counterparty token and removing X - the reserve of X falls, its ratio-price rises, and the buyer pays progressively more per unit as they consume the pool. The price impact is the formula's doing: larger trades move the ratio further, and the moving price is slippage made mechanical.
- The fee and the k: each trade carries a fee - typically a fraction of a percent - added to the reserves, and the fee is what compensates depositors for lending their tokens to traders. The fee accrues to the pool, which means it accrues to the depositors proportionally, and the fee is why providing liquidity pays.
- The invariant's limits: constant-product pools assume two fungible tokens and a simple ratio, and the assumption breaks for assets with external prices, fee-on-transfer tokens, or correlated pairs - which is why newer designs use different curves, stable-swap formulas for pegged assets, and dynamic fees for volatile ones.
LP tokens and what providing liquidity means
- The deposit and the receipt: depositing tokens into a pool mints liquidity provider tokens - LP tokens - representing the depositor's share of the pool. The LP token is a claim: redeem it for the pool's current reserves, proportional to the share the token represents.
- The withdrawal: redeeming LP tokens returns the depositor's proportional share of the reserves - including fees earned - and the withdrawal is instant in simple pools and queued or delayed in designs with lockups.
- The share's drift: because trades move reserves, the depositor's token mix drifts away from their deposit mix - withdrawing at any moment returns a different composition than deposited. The drift is not a bug; it is the mechanic, and it is the root of the divergence problem.
Where pool prices come from - and why they diverge
What pools are good at - and where they fail
The takeaway
Liquidity pools are exchanges replaced by reserves and formulas: constant-product invariants price trades by reserve ratios, fees compensate depositors, LP tokens represent claims on the pool, and arbitrage keeps pool prices aligned with the wider market. The design's value is coverage and availability - long-tail assets and always-open execution without required market makers - and its costs are borne by depositors: divergence when prices move, slippage in thin pools, and manipulation exposure in trusted prices. Reading pool claims correctly means knowing that the formula is the market, the fee is the yield, and the price is only as honest as the arbitrage that corrects it. The pool removed the counterparty; it did not remove the cost. It moved the cost onto the depositors, and the depositors are paid to accept it.