Automated Market Makers (AMMs) are the technology that powers decentralized exchanges. Instead of an order book matching buyers to sellers, AMMs use mathematical formulas that let anyone trade against a pool of assets at prices set by the pool's composition. This is a genuinely elegant piece of financial engineering — it lets exchanges run without any humans, market makers, or centralized infrastructure. This guide explains how they actually work, why the math works, and the differences between the major AMM designs.
The problem AMMs solve
Traditional exchanges match buyers and sellers via order books — you place a bid at $30,000 for BTC, someone else places an ask at $30,005, an engine matches them. This requires market makers to constantly provide bids and asks, and a centralized engine to match orders.
On a decentralized blockchain, matching an order book is expensive (every order update is a transaction) and requires trust (someone has to run the matching engine). AMMs work around this by replacing the order book with a mathematical formula.
The constant product formula (Uniswap V2)
The most famous AMM formula:
x * y = k
Where x and y are the quantities of two tokens in a pool, and k is a constant. Trades must preserve k.
Simple example:
- A pool holds 10 ETH and 30,000 USDC. So x=10, y=30,000, k=300,000.
- The implied price is 30,000/10 = 3,000 USDC per ETH.
- Alice wants to buy 1 ETH. After her trade, the pool must still have k=300,000.
- If pool has 9 ETH after, then it needs 300,000/9 = 33,333 USDC. So Alice pays 3,333 USDC for 1 ETH — worse than the spot price of 3,000.
- That extra cost (3,333 vs 3,000) is the price impact / slippage of her trade.
The formula creates a curve: small trades barely move price; large trades experience increasing slippage. This works because it makes the pool automatically resist depletion.
Why constant product works well enough
The x*y=k formula has three key properties that make it work in practice:
- Determinism. Anyone can compute the exact output for any input using only the current pool state. No matching engine needed.
- Never runs out of liquidity. No matter how much someone tries to buy, the formula still gives a price (just an increasingly bad one for large trades).
- Automatic arbitrage. If pool prices drift from external market prices, arbitrageurs buy the cheap side / sell the expensive side, restoring alignment.
The trade-off is slippage on large trades. A traditional order book with active market makers can execute large trades at close to spot. An AMM cannot without deep pools or specialized formulas.
Uniswap V3: concentrated liquidity
Uniswap V3 (launched 2021) introduced a major evolution: liquidity providers can specify a price range in which their liquidity is active.
This means an LP can concentrate their capital in the price range where they expect trading to happen (e.g., 3,000-3,500 USDC/ETH), instead of spreading it across all possible prices. In-range LPs earn much higher yields; out-of-range LPs earn nothing until price returns.
Trade-offs:
- Much higher capital efficiency — deeper liquidity where it matters.
- LPs must actively manage ranges as price moves.
- Impermanent loss can be amplified for narrow ranges.
Curve: optimized for pegged assets
Curve uses a modified formula (StableSwap) that keeps prices tightly clustered near 1:1 for pegged assets. This is critical for stablecoin swaps (USDC/USDT, DAI/USDC) and ETH-derivative swaps (ETH/stETH).
Curve's formula behaves like x+y=k for prices near the peg (very low slippage) and like x*y=k for prices far from peg (protecting the pool from depletion). This lets Curve offer 0.01% slippage on million-dollar stablecoin swaps — impossible with the vanilla Uniswap formula.
Balancer: multi-token weighted pools
Balancer generalizes the AMM formula to support pools with 2-8 tokens and custom weights. A 60/40 BTC/ETH pool behaves differently from a 90/10 BTC/ETH pool — the ratios stay near the target weights automatically as trades happen.
This makes Balancer pools work like self-rebalancing index funds. Some Balancer pools serve as on-chain ETF-style products.
How AMM aggregators work
Aggregators like 1inch, Odos, and CoW Swap route trades across multiple AMMs and other liquidity sources to find the best price. For large trades, they split orders across multiple pools to minimize slippage.
In 2026, most trades on major DeFi wallets (Rabby, MetaMask, Coinbase Wallet) route through aggregators automatically. This gives users the best of the AMM ecosystem without needing to know which pool has the best pricing at any moment.
What AMMs mean for traders
- Always available liquidity. No matter what token you're trading, if a pool exists, you can trade it 24/7.
- Price impact matters. Large trades pay more due to slippage. Break large trades into smaller ones or use aggregators.
- MEV exists. Bots monitor pending trades and front-run them for profit. Use MEV-protecting wallets and slippage tolerance carefully.
- Impermanent loss is real. Providing liquidity looks passive but has real risk from price divergence. See Impermanent Loss Explained.
AMMs are one of the genuine innovations of the DeFi era. They enable financial markets to run without any operator — a design that seemed impossible before 2020 and is now the largest source of on-chain trading volume. The math is simple; the implications are still being explored.
Related: DEX vs CEX · Liquidity Pools Explained · What Is DeFi?.




