What is an AMM?
An Automated Market Maker (AMM) is the engine behind most DEXs. Instead of matching buyers with sellers through an order book, an AMM uses a pool of tokens and a pricing formula to execute trades automatically.
The constant product formula
The most common AMM formula is x × y = k (used by Uniswap V2 and early PancakeSwap). Here, x and y are the quantities of two tokens in the pool, and k is a constant. When you buy Token A, you add Token B to the pool and remove Token A, changing the ratio and thus the price.
Concentrated liquidity AMMs (V3)
PancakeSwap V3 introduced concentrated liquidity — LPs can specify a price range for their capital. This makes AMMs dramatically more capital-efficient: instead of spreading liquidity across all possible prices (most of which are never traded), capital is concentrated where trading actually happens.
How AMMs generate fees
Every trade through an AMM pays a small fee (e.g. 0.01% on PancakeSwap V3 USDT/USDC). This fee is split among all liquidity providers in proportion to their share of the pool. High-volume pools generate significant fee income.