What Is an AMM? How Automated Market Makers Set Prices
Every PancakeSwap trade executes with no seller on the other side — no orderbook, no quotes, no waiting for a match. A formula prices it instantly. That formula is the Automated Market Maker, and it's the most consequential financial invention crypto has produced. Here's how it works, minus the whiteboard.
The problem it solved
Orderbooks need constant human (or bot) attention: someone must post and update quotes all day. That works for markets with professional market makers — and fails completely for the long tail of new tokens. AMMs replaced the market maker's judgment with a pool and a rule, making a liquid market something you can deploy in one transaction.
The core mechanism: a pool and an invariant
A pool holds two assets — say a token and USDX. The classic AMM rule is x × y = k: the product of the two balances must stay constant across a trade.
You don't need the algebra — you need its three consequences:
- The ratio is the price. A pool holding 1,000,000 tokens and 100,000 USDX prices the token at 0.1 USDX. No one sets this; holdings are the price.
- Every trade moves the price. Buying tokens removes them from the pool and adds USDX — the ratio shifts, the next buyer pays slightly more. This is price impact, and it's mechanical, not sentiment.
- Depth is everything. In a deep pool your trade barely dents the ratio; in a shallow one, the same trade is a cliff. This is slippage, and it's why liquidity depth decides trading quality.
Where fees fit
Each swap pays a fee — 0.25% or 1% on the pools our tools use — added to the pool for its liquidity providers. That's the entire LP business model: earn the toll on trades flowing through your capital.
v3: the AMM grows a brain
Classic AMMs spread pool capital across every price from zero to infinity — mathematically elegant, capital-inefficient. PancakeSwap v3 lets providers pick price ranges, concentrating capital where trading actually happens. The consequences are large enough that we wrote them up separately: concentrated liquidity explained — including v3's neatest trick, the one-sided position that behaves like a fee-earning limit order.
Why builders should care
Understanding AMMs turns several "mysteries" into levers:
- Your token's starting price is just the initial deposit ratio — set it deliberately when listing.
- Chart "support" from your own liquidity is a range you can position on purpose.
- Running the venue is a business: a branded swap frontend or a full DEX fork earns from every trade the formula prices.
One pool, one rule, prices without permission — that's the machine under every swap you've ever made.