What Is an AMM? Automated Market Makers Explained
An automated market maker (AMM) is the engine that powers most decentralised exchanges. Instead of matching buyers and sellers in an order book, an AMM uses a simple maths formula and a shared pot of tokens to set prices automatically. It's one of crypto's genuinely clever inventions — and understanding it helps you avoid some expensive surprises. This guide explains how it works, what 'slippage' really means, and why a pool can quietly turn against you.
The 20-second version
An AMM is a pricing formula, not a person. It holds two tokens in a pool and adjusts the price as people trade, so a price always exists — even at 3am with no buyers around. The trade-off is slippage and a risk for liquidity providers called impermanent loss.
Read this first
Maths, not magic
An AMM will always give you a price — even a terrible one. On thin pools, a single large trade can move the price sharply against you before you realise. Always check the expected output and set a slippage limit. This guide is education, not financial advice.
What is an AMM?
On a traditional exchange, a trade happens when a buyer and a seller agree on a price in an order book — a live list of everyone willing to buy or sell, at what price. It works beautifully, but only when there are lots of active traders on both sides. For a brand-new token with three fans and no professional market makers, the order book would be empty most of the time, and you simply couldn't trade.
An automated market maker removes the need for a counterparty entirely. Instead of waiting for someone to take the other side of your trade, it keeps a pool of two tokens — say ETH and a stablecoin — and uses a formula to decide the price based purely on how much of each token is currently in the pool. There's always liquidity and always a price, because you're trading against the pot, not against a person who has to show up.
The most common design, pioneered by Uniswap, is the constant product formula, usually written as x × y = k. Here x and y are the amounts of the two tokens in the pool, and k is a number that must stay constant. Buy ETH from the pool and you remove some x (ETH) and add some y (stablecoin); to keep k unchanged, the formula automatically pushes ETH's price up a little for the next buyer. Sell ETH back and the reverse happens. The price isn't set by anyone's opinion — it falls straight out of the maths.
Slippage and price impact
Because the formula moves the price *as you trade*, a big order doesn't all fill at one price — it 'slides' along a curve, getting gradually worse the further it goes. The first few coins you buy are cheap; the last few are dearer, because by then you've already shifted the balance of the pool. This gap between the price you expected and the price you actually got is called slippage, or price impact, and it's larger when:
- the pool is small (low liquidity), so even a modest trade noticeably shifts the balance, or
- your trade is large relative to the pool, eating deep into the curve, or
- the network is congested and the price moves underneath you before your trade lands.
Set a slippage limit
Most DEXs let you cap how much slippage you'll accept (often 0.5–1%). This protects you from 'sandwich' bots that spot your pending trade and dart in front of it to skim a profit. If a swap keeps failing despite a sensible limit, the pool is probably just too thin for the size you're trying to trade.
Who provides the tokens?
All those tokens in the pool have to come from somewhere — and they come from liquidity providers, ordinary users who deposit a matched pair of tokens and earn a share of every trading fee in return. On the surface it looks like easy passive income: park two tokens, collect fees while others trade. Tempting, and sometimes genuinely worthwhile.
But there's a catch with a deceptively gentle name. AMMs expose providers to impermanent loss — a situation where, if the two tokens' prices drift apart, you can end up with less value than if you'd simply held the tokens in your wallet and done nothing. The fees can outweigh it, or they may not. It's the single most misunderstood risk in providing liquidity, and worth fully understanding before you deposit a penny.
Where to go next
Now you understand the engine, see where it lives in what is a DEX, how the pots themselves are built in what are liquidity pools, and the key risk for providers in impermanent loss explained. If you're tempted to chase rewards on top, read what is yield farming before you do.
Key takeaways
- An AMM prices trades with a formula and a token pool instead of an order book.
- Uniswap-style AMMs use the constant product formula, x × y = k.
- Trading moves the price along a curve, which causes slippage — worse on thin pools and large orders.
- Pool tokens come from liquidity providers, who face the risk of impermanent loss.
Frequently asked questions
What does x*y=k actually mean?
It means the product of the two token balances in a pool stays constant. As you take one token out, the formula forces the price of the other up to keep that product unchanged — which is how the price adjusts automatically with every trade, no human needed.
Why did I get fewer tokens than the quote showed?
Slippage. Between the moment you saw the quote and the moment your trade actually confirmed on-chain, other people may have traded the same pool and moved the price. Setting a slippage tolerance caps how far the price is allowed to drift before your trade is cancelled.
Are all DEXs AMMs?
Most are, but not all. Some DEXs use on-chain order books instead, which is more common on fast, cheap chains like Solana where running an order book on-chain is practical. AMMs are simply the most widespread design because they work even when traders are scarce.
Keep reading
What Is a DEX? Decentralised Exchanges Explained
A plain-English guide to decentralised exchanges (DEXs): how they let you swap tokens without an account, how
What Are Liquidity Pools? A Beginner's Guide
Liquidity pools explained simply: how depositing token pairs powers DeFi swaps, how providers earn fees, and t
Impermanent Loss Explained (With a Simple Example)
What impermanent loss really is, why it happens to liquidity providers, a worked example, and how to think abo