Bible Network Crypto DeFi Onchain RWA AI Agent Stablecoin Chain SAFU CryptoTax DeFAI AGI Claude Me Claude Skill Claude Design Claude Cowork
Independent Media
Not affiliated with any project
The Deepest Crypto Knowledge Base
crypto-bible.com
LATEST
Perpetuals Enter US Regulated Markets: Kraken Launches CFTC-Compliant Perps via Bitnomial as Kalshi Led and Coinbase Followed  ·   ·   ·   ·  World (WLD) Enters Simple Plan Phase 3: From Token Subsidies to World ID Fees — How AI-Era Proof-of-Human Infrastructure Plans to Make Money  ·  MiCA Deadline Hits in Days: 75% of EU Crypto Firms May Lose Authorization, Millions of Users at Risk of Cutoff
Glossary · defi-basics

AMM (Automated Market Maker)

defi-basics Intermediate

30-Second Version · For the impatient
The mechanism decentralized exchanges (DEXs) use to match trades, replacing the traditional buy/sell order book with a mathematical formula. The most common version uses the 'constant-product formula x×y=k' to maintain the reserve ratio of two tokens, automatically adjusting the price with every trade. Uniswap is the most representative AMM protocol.
Full Explanation +
01 · What is this?

What is an AMM, and why do decentralized exchanges need it?

On a traditional centralized exchange (like Binance), trades are matched by an order book: buyers post buy orders, sellers post sell orders, and they execute when prices match. But order books need enough buyers and sellers online simultaneously for adequate liquidity; for small tokens, the bid-ask spread can be unacceptably wide. The deeper problem: a decentralized exchange (DEX) has no central server to efficiently match orders — porting a traditional order book on-chain is too expensive and too slow. AMM's answer: replace the order book with a liquidity pool, and manual matching with a math formula. The pool holds reserves of two tokens (say ETH and USDC), and a formula determines the exchange rate and price at any moment. No buy/sell orders to wait for, no counterparty to find — you want to buy, you trade directly with the pool; the formula automatically calculates how many tokens you receive and how much of the other you put in, updating the price instantly.

02 · Why does it exist?

How does the constant-product formula x × y = k work?

This is the core mechanism of most AMMs, and you don't need a math background to understand it. Imagine a liquidity pool with only ETH and USDC, holding 100 ETH and 200,000 USDC. Then k = 100 × 200,000 = 20,000,000, and the pool's implied ETH price is 200,000 ÷ 100 = $2,000. Now someone wants to buy 10 ETH from the pool. After they take it, the pool has only 90 ETH — but k must stay constant, so USDC must become 20,000,000 ÷ 90 ≈ 222,222. That means the buyer must put in 222,222 – 200,000 = 22,222 USDC to get 10 ETH, an average price of about $2,222 — 11% more expensive than the original $2,000. That gap is slippage. After the trade, ETH is scarcer (90 units) and the implied price rises to 222,222 ÷ 90 ≈ $2,469. No one needs to quote a price; the formula automatically completes the entire cycle of 'trade changes supply → supply changes price.' The curve can mathematically never let one token reach zero reserves (it would take infinite amounts of the other to buy it all out) — that's the formula's mathematical guarantee.

03 · How does it affect your decisions?

What is the fundamental difference between AMMs and order books, and what are the pros and cons of each?

Order books' strengths: price precision and no forced slippage — buyers and sellers name their own prices, trades execute at your chosen price, and large orders aren't necessarily costlier than small ones (depends on order depth). Weakness: requires liquidity providers to actively post orders; for small tokens, there's no counterparty at all or the bid-ask spread is prohibitively wide. AMMs' strengths: always liquid, no counterparty needed, 24/7 and permissionless — as long as the pool has tokens, anyone can trade anytime. Revolutionary for long-tail tokens (newly launched, small market cap). Weakness: high slippage on large orders, and AMMs are natural arbitrage targets — whenever external market price diverges from the pool's implied price, arbitrageurs come in to correct it, and liquidity providers bear the arbitrage loss (the source of impermanent loss). These aren't locked in a zero-sum battle; many DEXs use hybrid models (e.g. dYdX uses an order book), each serving different needs.

04 · What should you do?

What do liquidity providers receive, and why isn't it all upside?

Liquidity providers (LPs) deposit both tokens at the current ratio into the pool, receiving 'LP tokens' representing their share. Their income comes from transaction fees on every trade through the pool (Uniswap V2: 0.3%), distributed proportionally to their share. For example, if you hold 1% of the pool and it sees $1 million USDC in daily volume, you'd collect roughly 1,000,000 × 0.3% × 1% = $30 per day in fees. But LPs have two hidden costs to understand. First is impermanent loss, detailed in another entry in this series: when the relative price of the two tokens diverges, the value you withdraw is less than simply having held both tokens without doing anything. The greater the divergence, the larger the loss; fees must exceed that loss for LPing to actually be profitable. Second, fees are not guaranteed income: if trading volume is low or the pool is deep (many LPs splitting), your fee yield may be very thin — potentially eaten by gas costs. The core equation to evaluate whether a pool is worth joining: estimated annualized fee APR > impermanent loss estimate + gas costs + opportunity cost.

Real-World Example +

A real Uniswap scenario to ground the concept. During the DeFi peak season in 2021, the ETH/USDC 0.3% fee pool saw daily volumes often in the hundreds of millions. Say you became an LP with $10,000 USDC and equivalent ETH, representing roughly 0.01% of the pool. At trading volumes of that period, you'd collect roughly $50–100 USDC per day in fees, annualizing close to 200%. Sounds extremely attractive — but during the same period ETH rose from $2,000 to $4,000. Because you were an LP, the system continuously 'sold your ETH' for USDC (arbitrageurs constantly re-balancing the pool), so you didn't fully capture ETH's doubling. Some analyses showed: simply holding ETH and USDC without LPing over that stretch would have yielded far more than the fees. This example perfectly illustrates the double edge of LPing: when markets range and relative prices stay stable, fees are real and substantial. When markets make a one-directional surge, the LP mechanism systematically erodes your upside capture.

Diagram
AMM: x × y = k Keeps Price Moving Along a Curve圖左展示 10 ETH 交易前後的池子狀態(ETH 100→90,USDC 200K→222K,k 不變,價格從 $2,000→$2,469);中間曲線圖顯示定積曲線上的兩個點;右下兩欄分別說明交易者付出的成本(含滑點)與 LP 賺取的手續費。 AMM: x × y = k Keeps Price Moving Along a Curve Buy ETH from pool = less ETH, more USDC = price rises; sell = reverse Before Trade ETH: 100 USDC: 200,000 k = 100 × 200,000 = 20,000,000 Price = 200,000/100 = $2,000 / ETH buy 10 ETH After Trade ETH: 90 USDC: 222,222 k = 90 × 222,222 ≈ 20,000,000 ✓ Price = 222,222/90 = $2,469 / ETH ↑ Price Curve ETH in pool ◀ USDC ◀ Before After You paid (cost of 10 ETH) 222,222 - 200,000 = $22,222 USDC avg price = $2,222 (slippage vs $2,000 spot) LP earns 0.3% fee on trade = ~$66 USDC distributed to all LPs proportional to share No counterparty needed — the pool IS the market maker, always ready to quote any size Larger trades = more slippage · Deeper pools = less slippage Crypto Bible · crypto-bible.com
Feel free to share. Please credit the source.
Common Misconceptions +
✕ Misconception 1
× Myth 1: The 'price' in an AMM pool is the market price of that token. Not entirely. A pool's implied price only reflects the supply and demand of that specific pool and can diverge from other exchanges' prices. Arbitrageurs usually close the gap within seconds to minutes, but during low-liquidity periods or extreme volatility, AMM price can temporarily diverge severely from the true market price. Always check the pool's depth before placing large orders.
✕ Misconception 2
× Myth 2: As long as the APY is high enough, you can blindly provide liquidity. High APY usually comes from high fee tiers or token-incentive subsidies from new pools. The former is fine; the latter requires watching whether token rewards will collapse once incentives end. Most critically: high-APY pools tend to involve high-volatility token pairs with the largest impermanent loss — you must factor that in and not just look at the APY number.
The Missing Link +
Direct Impact

The core trade-off of trading on an AMM is 'always liquid, no permission needed' in exchange for 'slippage and possible MEV loss.' For small trades and long-tail tokens, AMMs are often the only option — there's no order book market. For large trades, AMM slippage costs can far exceed expectations; aggregators (like 1inch) split your large order across multiple DEXs and AMM pools to reduce total slippage. For providing liquidity, the trade-off is 'earning fees' in exchange for 'bearing impermanent loss and opportunity cost.' No AMM pool is 'unconditionally good' — always calculate expected fee APR, impermanent loss, gas, and opportunity cost together.

Ask a Question
Please enter at least 10 characters
More Related Topics