AMM

An Automated Market Maker (AMM) is a decentralized exchange (DEX) mechanism that prices assets algorithmically using a mathematical formula rather than matching buyers and sellers through an order book. Users trade against a shared pool of tokens deposited by liquidity providers (LPs), who earn a fee percentage on every trade. AMMs are the foundational primitive of DeFi trading — Uniswap, Curve, Balancer, and most DEXs are built on AMM models.


The Core Problem AMMs Solve

Traditional order books require active market makers quoting buy and sell prices to provide liquidity. In crypto, two problems emerge:

  1. Smart contracts cannot run the high-frequency algorithms needed for professional market making
  2. New tokens have no established market makers willing to quote them

AMMs replace human market makers with an algorithm. Anyone can provide liquidity; anyone can trade — no intermediary, no permission required.


The Constant Product Formula

Uniswap popularized the constant product formula, still the most widely used AMM design:

$$x cdot y = k$$

Where:

  • $x$ = reserve of token A
  • $y$ = reserve of token B
  • $k$ = constant (never changes within a single trade)

How this prices trades: If you add token A to the pool (increasing $x$), the protocol calculates how much token B must leave to keep $k$ constant. The ratio $y/x$ sets the price.

Example: A pool has 100 ETH and 300,000 USDC ($k$ = 30,000,000)

  • Buying 10 ETH: new $x$ = 90, so new $y$ = 30,000,000 / 90 = 333,333 USDC
  • You paid 333,333 – 300,000 = 33,333 USDC for 10 ETH (average $3,333 vs. previous $3,000)
  • The price premium above spot is price impact — higher for larger trades relative to pool size

Types of AMM Formulas

AMM Type Formula Best For Example
Constant Product $x cdot y = k$ General token pairs Uniswap v2
StableSwap Hybrid constant sum/product Stablecoin pairs Curve Finance
Concentrated Liquidity LP sets price ranges Capital efficiency Uniswap v3
Weighted Pools Multi-asset with custom weights Index-like pools Balancer
Virtual AMM (vAMM) No real assets, just pricing Perpetual futures GMX v1

Liquidity Providers (LPs)

LPs deposit equal values of two tokens into a pool and receive LP tokens representing their share. They earn:

  • Trading fees (typically 0.05%–1% per swap)
  • Liquidity mining rewards (protocol token emissions, where applicable)

Key risk: Impermanent Loss (IL)

LPs don’t just hold the same token amounts — the pool rebalances constantly. If token A rises vs. token B, the pool automatically sells A and buys B. The LP ends up with less of the appreciating token than if they had just held. This “impermanent” loss becomes permanent when LPs exit.

IL is the central risk all LP positions carry, and the reason “just buy and hold” often outperforms providing liquidity for volatile pairs.


Concentrated Liquidity (Uniswap v3)

Uniswap v3 (2021) introduced concentrated liquidity: instead of providing liquidity across the entire price curve (0 to ∞), LPs specify a price range. Capital is 100x or more concentrated in the active range, dramatically increasing fee yield per dollar — but LPs must manage their ranges as prices move.


Slippage and Price Impact

  • Slippage — Difference between expected price and execution price due to market movement or AMM formula
  • Price impact — The change in price caused by a specific trade’s size relative to pool liquidity

Large trades in thin pools have severe price impact. For a $1M trade into a $500k pool, price impact can exceed 50%.


History

  • 2017 — Bancor launches the first major AMM on Ethereum
  • 2018 — Hayden Adams launches Uniswap v1 with the $x cdot y = k$ formula; Uniswap becomes the AMM standard
  • 2019 — Uniswap v2 adds ERC-20/ERC-20 pairs (vs. v1’s ETH-only base)
  • 2020 — Curve Finance launches StableSwap, optimized for stablecoin pairs with minimal slippage. SushiSwap forks Uniswap via “vampire attack.” DeFi summer ignites AMM adoption.
  • 2021 — Uniswap v3 launches concentrated liquidity, transforming LP strategies
  • 2022-present — AMM wars continue: Balancer v2, Curve v2, Uniswap v4 (hooks system)

Social Media Sentiment

AMMs are beloved and criticized in DeFi circles. The elegance of $x cdot y = k$ is cited as one of crypto’s great innovations. LPs regularly complain about impermanent loss after losing money despite collecting fees. Concentrated liquidity introduced active management complexity that many retail LPs found overwhelming. Uniswap v4 (hooks) generated significant developer excitement for its composability.


Last updated: 2026-04

Related Terms


Sources