π Automated Market Maker AMM
A smart-contract system that lets you swap one crypto token for another against a shared pool of funds. A math formula sets the price automatically, so there's no buyer or seller on the other side β and no human in the middle.
πͺ The simple version β a self-service exchange machine
Picture a currency-exchange machine with two jars of money and no teller. A fixed rule decides the rate: put one currency in, take the other out. The more you drain from one jar, the worse the rate gets for the next person. An AMM is that machine, built as a smart contract. Instead of jars it holds two tokens in a liquidity pool, and instead of a person setting prices, a formula does it on its own.
π Order book vs. pool β what's the difference?
A traditional exchange uses an order book: a list of people's buy and sell orders, matched together when prices line up. An AMM throws that out. There's no list and no counterparty to find β you trade directly against the pool's reserves. That's why a beginner can swap tokens on a decentralized exchange with no account, no sign-up, and no one waiting on the other side.
| Order book | AMM pool |
|---|---|
| Matches a buyer with a seller | You trade against a shared pool |
| People post prices | A formula sets the price |
| Needs an account / exchange | Just connect a wallet and swap |
β The formula behind the price β x Γ y = k
Most AMMs use the constant product formula: multiply the amount of each token in the pool, and that result (k) must stay the same. So if you take one token out, you have to put enough of the other in to keep k unchanged. That single rule sets the price.
π Example: a pool with 10 ETH and 20,000 USDC gives k = 200,000, so 1 ETH β 2,000 USDC. Buy some ETH and the pool's ETH drops, so each remaining ETH costs more. The bigger your trade is next to the pool's size, the worse that price shift β and that's exactly what slippage means.
π Who fills the pool? Liquidity providers
The tokens in the pool have to come from somewhere. Anyone can be a liquidity provider (LP) by depositing a pair of tokens β usually equal value of each. In return you get LP tokens that represent your share, and you earn a cut of the trading fees every time someone swaps. To withdraw, you hand the LP tokens back and take your share out. This is the foundation of how liquidity works across DeFi.
π¨ Things beginners should know
- π Slippage on big trades β Drain a lot from a small pool and the price moves against you; check the expected output before confirming
- βοΈ Impermanent loss β As an LP, if the two tokens' prices drift apart you can end up with less value than just holding them
- π£ Not free income β Fees can be outweighed by impermanent loss, so providing liquidity is a real bet, not guaranteed yield
- π Smart-contract risk β The pool is code; a bug or exploit can drain funds, so the contract behind it matters
π Where you'll meet one
AMMs are the engine behind decentralized exchanges. Uniswap launched on Ethereum in 2018, popularized the AMM model, and is the largest DEX by trading volume. PancakeSwap is the leading AMM on BNB Chain. The first time you "swap" a token on a DEX, you're using an AMM.
β FAQ
- When I swap on a DEX, am I trading with another person?
- No. You trade against the pool and its formula, not against a buyer or seller on the other side. The smart contract takes the token you put in, gives you the other token back, and recalculates the price automatically.
- Why did my price get worse on a big trade?
- That's slippage. Most AMMs use the formula x * y = k, so taking a lot of one token out of the pool forces the other side up. The bigger your trade is compared to the pool's size, the more the price moves against you.
- Is providing liquidity free passive income?
- No. You earn a cut of the trading fees, but you also face impermanent loss β if the two tokens' prices drift apart, you can end up with less value than if you had simply held them. The fees can be outweighed by that loss, so it is not risk-free.