Glossary TermApril 20, 2024

AMM

Automated Market Maker — a smart contract that replaces traditional order books with mathematical formulas, enabling permissionless trading and liquidity provision.

ammautomated-market-makerdexdefiliquidity-pool

Definition

Automated Market Maker — a smart contract that replaces traditional order books with mathematical formulas, enabling permissionless trading and liquidity provision.

AMM

In Simple Terms: An AMM is a robot market maker. Instead of matching buyers and sellers like a traditional exchange, it uses a math formula (x × y = k) to price assets automatically. You trade against a pool of tokens, not against another person. The pool never runs out of either token — it just gets more expensive as you drain one side. This is why you can always trade on a DEX, even if no one else wants to take the other side.

An Automated Market Maker (AMM) is a decentralized exchange mechanism that uses a mathematical formula to determine asset prices and execute trades, replacing the traditional order book of bids and asks with a pool of tokens deposited by liquidity providers. The AMM algorithm ensures that the product of the quantities of the two tokens in the pool remains constant (or follows a more complex invariant), so as one token is bought and its quantity in the pool decreases, its price automatically increases according to the formula.

For traders, understanding AMM mechanics is essential for anyone trading on decentralized exchanges, providing liquidity, executing arbitrage between DEXes and CEXes, or analyzing on-chain flow. AMMs behave differently from order book exchanges in ways that create both risks (price impact on large orders, sandwich attacks, impermanent loss) and opportunities (arbitrage across pools, providing liquidity in high-volume pairs, first-mover advantage in new pools). The rise of concentrated liquidity AMMs (Uniswap V3) has transformed LP provision from passive yield into an active strategy that behaves more like options writing than traditional market making.

How It Works

Constant product AMM (Uniswap V2, PancakeSwap):

The fundamental formula: x × y = k, where x and y are the quantities of the two tokens in the pool, and k is constant (ignoring fees). When you swap Token A for Token B, you add A to the pool and remove B. The pool automatically adjusts prices so that the product remains constant.

Example: A USDC/ETH pool has 100,000 USDC and 50 ETH. k = 5,000,000. The implied price of ETH = 100,000 / 50 = $2,000.

A trader wants to buy 1 ETH. The new ETH balance will be 49 ETH. To maintain k = 5,000,000: New USDC = 5,000,000 / 49 = 102,040.82 USDC. The trader pays 102,040.82 - 100,000 = 2,040.82 USDC for 1 ETH — an effective price of $2,040.82, above the spot $2,000. The difference is price impact (slippage from moving the pool).

Constant sum AMM: x + y = k. Used for stable-asset pairs (no price impact, but one side can be drained). Almost never used alone.

Constant mean AMM (Balancer): Weighted pools where the invariant balances multiple tokens with custom weights (e.g., 60% ETH / 40% USDC). Allows for lower IL on favored assets.

Concentrated liquidity (Uniswap V3): LPs choose a specific price range. Within that range, liquidity is aggregated (higher capital efficiency, more fees). Outside the range, the position provides zero liquidity and holds 100% of one token. This makes LP provision an active strategy akin to writing options.

Curve's stableswap invariant: A hybrid of constant product and constant sum, designed for assets that trade near 1:1 (stablecoins, pegged assets). Minimizes IL and price impact near the peg while preventing pool drainage at extreme ratios.

Why It Matters for Traders

AMM price impact is a hidden transaction cost. On a central limit order book (CEX), you pay the spread plus a small fee. On an AMM, you pay the fee plus price impact — the slippage from moving the pool price. For small trades on deep pools, impact is negligible. For large trades or small pools, impact can exceed the fee by multiples. Before executing any significant DEX trade, check the pool depth and calculate expected price impact. For ETH/USDC on Uniswap mainnet, a $1M swap has minimal impact (~0.05%). The same trade on a $5M TVL altcoin pool could move the price 20%+.

AMM behavior enables MEV extraction. The deterministic pricing formula and transparent mempool make AMM trades vulnerable to frontrunning and sandwich attacks. A bot sees your trade in the mempool, buys before you (raising the price), lets your trade execute at the higher price, then sells after you (pocketing the difference). This is why DEX trades often execute at worse prices than displayed. Using MEV-protected RPCs (Flashbots, MEV Blocker) or trading through aggregators with slippage protection mitigates this risk.

Cross-pool arbitrage creates opportunities. When the same asset trades at different prices across AMM pools (or between AMMs and CEXes), arbitrageurs rebalance the pools and capture the spread. These opportunities are mostly harvested by bots in milliseconds, but understanding the dynamics helps you: (a) avoid executing at stale prices (use aggregators that split trades across pools), (b) anticipate when large arbitrage flows will affect related markets, and (c) identify when a pool's price is temporarily dislocated (don't trade against it).

Common Mistakes

  1. Trading on AMMs without checking pool depth. A pool can show a price of $100 for a token with $10,000 total liquidity. Your $1,000 trade will move the price dramatically — your actual execution price may be $120 or $80 depending on direction. Always check TVL and the price impact estimate before confirming any DEX trade. For tokens with small pools, the CEX (if available) almost always offers better execution.
  2. Assuming the pool price is the "correct" price. AMM prices are determined by the pool's balance ratio, which can diverge from the broader market price if arbitrage is slow (thinly traded pools, cross-chain latency, MEV congestion). The AMM price is an offer, not a market consensus. Cross-reference with aggregator quotes or CEX prices before trading significant size.
  3. Providing liquidity without understanding concentrated vs. full-range implications. On Uniswap V3, if you provide liquidity with a narrow range and price exits that range, you earn zero fees until it returns. Your capital sits idle while you hold a now-imbalanced position. For passive liquidity providers, full-range (or wide-range) positions are more forgiving. For active LPs who monitor and rebalance, concentrated positions offer higher capital efficiency.

FAQ

Q: Are AMMs better than order book exchanges? A: For different things. AMMs excel at: permissionless listing (anyone can create a pool), guaranteed liquidity (you can always trade), composability (pool tokens can be used in other DeFi protocols), and passive income for LPs. Order books excel at: precise execution prices, support for complex order types, lower fees for large trades, and resistance to MEV extraction. The best trading strategy often involves both: use CEXes for large size and precise entries, use AMMs for assets not listed on CEXes and for earning yield on idle capital.

Q: Why are AMM fees lower on L2s than on Ethereum mainnet? A: AMM fees are set by pool creators (typically 0.05% to 1%) plus gas costs. Gas is the transaction fee paid to the L1 or L2 network. On Ethereum mainnet, gas can be $5-50+ per swap, making small trades uneconomical. On L2s (Arbitrum, Optimism, Base), gas is $0.01-0.10, making even small trades viable. The AMM fee (0.3% on standard Uniswap V2 pools) is the same across chains; the gas savings are what make L2 trading cheaper.

Q: What is the most profitable AMM LP strategy? A: The most consistently profitable strategy is providing liquidity for high-volume stablecoin pairs (USDC/USDT) on concentrated liquidity AMMs — near-zero IL, predictable fee income, and capital-efficient ranges. For volatile pairs, profitability depends on your ability to predict the trading range: if you correctly range-bind price, concentrated LP can outperform spot holding; if you are wrong, IL erodes or exceeds fees. The most sophisticated LPs use dynamic rebalancing bots that adjust ranges as prices move, but this is a high-infrastructure strategy.

Deep Dive

Want to explore further? Check out:

Ready to Start Trading?

Join The Kingfisher community and get access to professional-grade trading tools and insights.