An AMM, or automated market maker, is a way to run an exchange without an order book: a smart contract formula sets the price and trade size based on the token reserves in a liquidity pool. Most decentralized exchanges work this way.
How the formula sets the price
The best-known formula is the constant product: x × y = k. Here x and y are the amounts of the two tokens in the pool, and k must stay the same after a trade (ignoring fees). When a buyer takes token X out of the pool and adds token Y, X becomes scarcer and pricier while Y becomes more plentiful and cheaper. The price is recalculated after every trade, so an AMM is always ready to trade at any size; a large trade simply gets a worse price. Other formulas exist too: for stablecoin pairs that should trade almost at par, AMMs use curves that barely move the price near the peg.
How it differs from an order book
On a traditional exchange, liquidity comes from market makers who post buy and sell orders and decide for themselves at what price to trade. In an AMM, the pool plays the market maker, and anyone can add to it. That is why a market for a new token exists from its first minute. But the formula has no opinion about price: it does not know what the token costs elsewhere. Arbitrageurs pull the pool's price toward the wider market by buying where it is cheaper, selling where it is dearer and pocketing the difference.
Concentrated liquidity
In a simple AMM, liquidity is spread across every price from zero to infinity, and most of it never gets used. Concentrated liquidity pools emerged in response: the provider picks a price range in which their money will work. While the price stays inside, they earn more fees on the same capital. If the price leaves the range, the whole position turns into one of the two tokens and stops earning until the price comes back or the provider resets the range. This demands attention and amplifies impermanent loss.
Risks and limitations
AMMs have weak spots that order books lack. Bots watch pending transactions in the mempool and can place trades right before and after them to profit from someone else's slippage; this is known as a sandwich attack. The defence is a low slippage tolerance. Prices in small pools are easy to push around, and if another protocol uses such a price as a reference, it opens the door to manipulation. And liquidity providers bear impermanent loss by the very design of the formula. This is not investment advice.
Hypothetical example: a pool holds 10 coins of X and 20,000 USDT, so k = 200,000 and the price is 2,000 USDT per coin. A buyer wants one coin of X. After the trade the pool will hold 9 coins, so its USDT must rise to 200,000 / 9 ≈ 22,222. The buyer pays about 2,222 USDT, 11% above the starting price, because the pool is small. The new pool price is about 2,469 USDT, and arbitrageurs will sell X into the pool until the price returns to the market level.
Related terms
Decentralized ExchangeLiquidity PoolImpermanent LossMarket MakerOrder BookMempool
On the site
Coin categoriesNew coinsMarket makers
This article was written by AI. Check specific rates, taxes and broker terms with primary sources.