What Is an AMM, and How Does It Work?
An automated market maker prices crypto trades with a formula and a liquidity pool, not an order book. Learn how pools work, what providers earn and the risks.
On this page
Short answer
An AMM, or automated market maker, is a smart contract that prices crypto trades with a formula and a pool of tokens rather than an order book. Traders swap against the pool, liquidity providers fund it and earn fees, and the price shifts with the pool's balance after every trade.
What is an AMM?
An AMM, or automated market maker, is a smart contract that prices crypto trades using a formula and a pool of tokens, instead of matching buyers and sellers in an order book. Traders swap against the pool, and the price moves as the pool's balance changes.
Anyone can trade on an AMM at any time, as long as the pool holds the tokens involved. There is no need to wait for another trader to accept your price, which is why AMMs work well for tokens that trade in small volumes.
The pool is funded by liquidity providers, who deposit pairs of tokens and earn a share of the trading fees. In return they accept the risk that the value of their deposit changes with the market. You can read how the wider system works in what a DEX is.
How does an AMM set a price?
An AMM sets its price from the ratio of the two tokens in its pool. The most common formula is the constant product rule, written as x times y equals k, where x and y are the two token balances and k stays fixed during a trade.
When you buy one token from the pool, you add the other token and remove the one you bought. The ratio shifts, so the price of the token you bought rises and the price of the one you sold falls. Large trades move the price more, which is called slippage.
For example, a pool holding 100 ETH and 200,000 USDC prices ETH at 2,000 USDC. If you buy 10 ETH, the pool keeps 110 ETH and about 181,818 USDC, so you receive about 18,182 USDC worth of ETH at an average price near 1,818 USDC per ETH.
Other AMMs use different formulas for tokens that should stay near the same price, such as stablecoins. Those formulas keep prices steady for small trades and only move sharply when the pool becomes very unbalanced.
What is a liquidity pool?
A liquidity pool is a smart contract that holds two tokens so traders can swap between them. It replaces the order book: instead of listing buy and sell orders, traders exchange directly with the pool at the price its formula gives.
Pools are created and funded by liquidity providers. A provider deposits both tokens in the current ratio, for example equal values of ETH and USDC, and receives pool tokens that represent their share of the pool.
Each pool is separate. A pool for ETH and USDC has its own price, and a pool for the same pair on another exchange can show a slightly different price. Arbitrage traders buy where it is cheap and sell where it is dear, which keeps prices close across pools. The mechanics of these pools are covered in what a liquidity pool is.
How do liquidity providers earn?
Liquidity providers earn a share of the trading fees paid by everyone who swaps in the pool. Each trade pays a small fee, often around 0.3% of the trade size, which is added to the pool and shared in proportion to each provider's deposit.
Providers can withdraw at any time by returning their pool tokens. They receive their share of both tokens plus the fees earned while the funds were in the pool. Some pools also pay extra rewards in a governance token, but those rewards are set by the protocol and can change.
| Pool type | Typical fee tier | Price movement | Fee income |
|---|---|---|---|
| Stablecoin pair | 0.01–0.05% | Small | Low but steady |
| Volatile pair | 0.3% | Large | Higher but uneven |
| New token pair | 1% | Very large | High, with high risk |
Fee tiers are set when the pool is created, and higher tiers usually match pairs where prices move more. A stablecoin pool earns little per trade but trades often, while a new token pool earns more per trade and can lose value fast.
Earnings depend on trading volume. A busy pool earns more fees, while a quiet pool earns little. Fees alone do not tell the whole story, because the value of the deposit can fall if prices move — a risk known as impermanent loss.
Example (hypothetical): providing liquidity for a month
Example (hypothetical): a trader deposits 5 ETH and 10,000 USDC into a pool that holds 50 ETH and 100,000 USDC in total, so the trader owns 10% of the pool. The pool charges a 0.3% fee on every trade.
Over a month, traders swap 1,000,000 USDC of volume through the pool. Total fees are 0.3% of 1,000,000, which is 3,000 USDC. If the trader owns 10% of the pool, their share of the fees is 300 USDC.
At the end of the month ETH trades at 2,400 USDC. The trader's 10% share of the pool is now about 4.56 ETH and about 10,954 USDC, worth about 21,898 USDC in total, plus the 300 USDC in fees.
If the trader had simply held 5 ETH and 10,000 USDC, the holding would be worth 22,000 USDC. The pool share plus fees comes to about 21,898 + 300 = 22,198 USDC, so the fees more than covered the small gap in this case — but the gap grows when prices move further.
What are the risks of AMMs?
The main risks of AMMs are impermanent loss, slippage, smart contract bugs and thin liquidity. Each one can be managed, but none of them can be removed entirely.
- Impermanent loss. When the price ratio of the two tokens changes, a pool deposit can be worth less than simply holding both tokens. The loss is only locked in when you withdraw.
- Slippage. Large trades move the price against you. Check the expected price and set a slippage limit before confirming.
- Smart contract risk. An AMM is code, and code can have bugs. Pools that have been audited and used for a long time carry less of this risk.
- Thin liquidity. Small pools can be drained by a single large trade, and new tokens can be hard to sell at a fair price.
Stablecoin pairs have smaller price moves and lower impermanent loss, but they still carry contract risk. For teams building on AMMs, a smart contract audit is a standard step before launch.
What are the common mistakes?
The most common AMM mistakes are ignoring slippage, providing liquidity to a token you do not understand, and treating fee income as profit without counting impermanent loss.
- Trading without checking slippage. A trade that looks cheap can cost far more if the pool is small or the trade is large.
- Chasing the highest fee rate. High fees often come with volatile pairs, where impermanent loss can exceed the fees earned.
- Forgetting the second token. You must deposit both tokens in the pool's ratio; depositing only one side is not possible.
- Leaving approvals open. Unlimited token approvals let a contract move your funds later; approve only what you need.
- Assuming the price is the market price. A small pool can show a price far from other exchanges, so compare before trading.
Key takeaways
- An AMM prices trades with a formula and a liquidity pool, not an order book
- The constant product rule keeps x times y fixed, so large trades move the price
- Liquidity providers earn a share of trading fees, often around 0.3% per trade
- Impermanent loss can make a pool deposit worth less than simply holding
- Check slippage and pool size before every trade
Frequently asked questions
What does AMM stand for?
AMM stands for automated market maker. It is a smart contract on a blockchain that lets people trade crypto without a central exchange or an order book, using a pool of tokens and a pricing formula instead.
How is an AMM different from a normal exchange?
A normal exchange matches buy and sell orders from traders. An AMM holds tokens in a pool and lets anyone trade against that pool at a price set by a formula, so trades settle at any time without a matching counterparty.
What is impermanent loss?
Impermanent loss is the gap between holding two tokens and depositing them in a pool when their price ratio changes. The pool rebalances as traders swap, so withdrawing later can leave you with less value than holding would have.
Do I need both tokens to provide liquidity?
Yes, in most pools you deposit both tokens in the pool's current ratio, for example equal values of ETH and USDC. You receive pool tokens that represent your share, and you can withdraw your share plus earned fees later.
Are AMMs safe?
Established AMMs with audited code and deep pools are widely used, but no AMM is risk-free. Smart contract bugs, thin liquidity and sharp price moves can all cause losses, so start small and check the pool before trading.
Can anyone create an AMM pool?
On most decentralised exchanges, yes. Anyone can create a pool for a token pair and set the fee tier where the exchange allows it. New pools often have thin liquidity, so prices there can move sharply on small trades.