Chapter 5

Automated Market Makers

Automated market makers, or AMMs, replace a traditional order book with a pool of assets and a pricing rule. The most famous rule is the constant product formula, often summarized as x times y equals k.

The exact math can wait. The important intuition is that when traders remove one asset from the pool, they must add enough of the other asset to keep the pool balanced under the rule.

In that example, the pool has less ETH after the trade, so the next buyer faces a worse price. That is the mechanical reason AMMs quote different rates for small and large swaps.

AMMs made on-chain trading much easier to bootstrap because anyone could contribute liquidity instead of waiting for a full order book to form.