What Is an AMM? How Trading Works Through Liquidity Pools
Who sets the price when you buy or sell crypto? Traditional exchanges match buyer and seller orders, while decentralized exchanges work differently. A program called an automated market maker, or AMM, calculates prices through formulas. This guide explains the essentials for beginners.
What Is an AMM?
AMM stands for Automated Market Maker. A smart contract automatically sets prices and executes trades without a person or order book. Mainly used on decentralized exchanges (DEXs), AMMs power the familiar swap function.
A traditional exchange matches someone offering to sell at KRW 10,000 with someone willing to buy at KRW 10,000. An AMM does not find another trader. Instead, you trade with a pre-funded store of assets called a liquidity pool.
Liquidity Pools and x × y = k
A liquidity pool contains a pair of tokens. For example, an ETH-USDT pool holds Ethereum and a stablecoin together. People who fund the pool are called liquidity providers.
The most widely used pricing formula is x × y = k. Here, x is the amount of one token, y is the amount of the other, and k remains constant.
Suppose a pool contains 100 ETH, x, and 200,000 USDT, y. Then k = 100 × 200,000 = 20,000,000. If someone adds USDT and removes ETH, ETH falls and USDT rises. Maintaining k raises the price as the remaining ETH decreases. Thus, more buying makes a token more expensive, while more selling makes it cheaper.
Slippage: Why Larger Orders Become Less Favorable
Because of the formula, trading a large amount at once moves the price away from your desired level. This difference is called slippage.
- Small trade: Small relative to the pool, with little price movement.
- Large trade: Significantly changes the balance, causing a more expensive buy or cheaper sale than expected.
- Smaller pool: The same amount creates more slippage.
Most DEXs let users set slippage tolerance before trading. Too narrow a tolerance can fail the trade; too wide a tolerance can cost you money, so adjustment matters.
What Is Impermanent Loss?
Liquidity providers receive trading fees but also face impermanent loss (IL). A change in the relative prices of the two deposited tokens can leave the position worth less than simply holding them in a wallet.
| Situation | Result |
|---|---|
| The tokens' price ratio stays the same | No loss; fees provide the gain |
| One token rises or falls substantially | Impermanent loss may occur |
It is called impermanent because the loss disappears if the original price ratio returns. Without recovery, it becomes a realized loss. Compare fees with IL: fees exceeding IL mean a gain, and fees below IL mean a loss.
Recap
AMMs set prices through liquidity pools and formulas instead of an order book, forming a foundation of DEXs and DeFi. Slippage and impermanent loss are costs and risks beginners often overlook.
This article explains technology for information and is not investment advice. Cryptocurrency is highly volatile, can lose principal, and guarantees no returns. No one can predict whether a coin will rise or fall. Understand the structure fully before providing liquidity or trading, and decide carefully within what you can afford to lose.
NOONOO TRADING invites you to follow live trading in our free chat.
Start in the bot📈 OKX trading fee discount for new registrations
Register for the OKX Fee Discount →