What is an AMM?
An Automated Market Maker (AMM) is a type of decentralized exchange (DEX) protocol that uses a mathematical formula to price assets, rather than relying on a traditional order book with buyers and sellers.
How It Works
Instead of matching buy and sell orders, an AMM uses a liquidity pool — a smart contract holding reserves of two (or more) tokens. The price is determined by the ratio of tokens in the pool.
The Constant Product Formula
Most AMMs (like Uniswap V2) use the formula:
x * y = k
Where:
x= amount of Token A in the pooly= amount of Token B in the poolk= constant (must remain unchanged after each trade)
This means as you buy more of Token A, the pool has less of it, so the price goes up.
Liquidity Providers (LPs)
Anyone can become a liquidity provider by depositing an equal value of both tokens into the pool. In return, LPs receive:
- LP tokens representing their share of the pool
- Trading fees (typically 0.3% per trade on Uniswap V2)
Key Concepts
- Slippage: The difference between expected and actual trade price
- Impermanent Loss: The risk of providing liquidity vs. simply holding
- TVL: Total Value Locked in the pool
Popular AMMs
| Protocol | Chain | Key Feature |
|---|---|---|
| Uniswap | Ethereum | Gold standard, V3 concentrated liquidity |
| Curve | Multi-chain | Optimized for stablecoin pairs |
| PancakeSwap | BNB Chain | Largest BSC AMM |
| Balancer | Ethereum | Multi-token pools (up to 8 tokens) |