hedgefund.wiki — institutional knowledge base

Automated Market Maker

Crypto & Digital Assets · advanced · CC-BY-4.0

An automated market maker (AMM) is a type of decentralized exchange protocol that replaces the traditional order book with a mathematical formula governing asset prices as a function of the ratio of assets held in a liquidity pool, enabling permissionless, continuous trading of digital assets without a centralized intermediary or active market maker. AMMs are the foundational primitive of decentralized finance (DeFi), with Uniswap's constant-product formula (x × y = k) establishing the dominant paradigm.

Key takeaways

Explanation

The AMM's core innovation is replacing a human or algorithmic market maker with a deterministic pricing function enforced by smart contract code on a blockchain. In the traditional order book model, prices emerge from the intersection of buyers' bids and sellers' asks—requiring active market makers to quote continuously. In an AMM, a liquidity pool holds two (or more) assets, and the exchange rate is determined by the mathematical relationship between pool reserves. Any participant can trade against the pool at any time, with the price automatically adjusting to reflect the trade's impact on reserves.

The constant-product invariant (x × y = k) was introduced by Uniswap in 2018 and remains the most widely used AMM formula. If a pool contains 100 ETH and 200,000 USDC (k = 20,000,000), purchasing 10 ETH requires depositing enough USDC to maintain k: new USDC amount = 20,000,000 / (100 - 10) = 222,222 USDC. The 10 ETH costs 22,222 USDC (price impact of approximately 11% for this size trade), compared to an initial implied price of 2,000 USDC/ETH. This price impact is the AMM's analogue to market impact in traditional markets—it increases with trade size relative to pool depth and creates the arbitrage incentive that keeps AMM prices aligned with broader market prices.

Impermanent loss is the AMM's fundamental risk for liquidity providers. Consider a LP who deposits $10,000 of ETH and $10,000 of USDC into a pool when ETH = $2,000. If ETH appreciates to $4,000, arbitrageurs extract ETH from the pool until the pool price reflects $4,000. At that point, the LP's share has rebalanced to approximately $8,165 USDC and 2.04 ETH (worth $8,165), totaling $16,330—versus $20,000 if they had simply held the original assets. The $3,670 difference is the impermanent loss (16.3% of the hold value). Impermanent loss becomes permanent when LPs withdraw at an unfavorable price ratio.

Concentrated liquidity, introduced by Uniswap v3, allows LPs to specify a price range [P_low, P_high] within which they provide liquidity. Outside this range, the LP's position is entirely in one asset and earns no fees. This design amplifies capital efficiency for LPs who correctly predict price ranges—a position providing liquidity only between $1,900–$2,100 per ETH concentrates approximately 20× more capital per tick than a full-range position, earning commensurately more fees. However, this efficiency comes at the cost of increased impermanent loss risk and active management: the LP must continuously manage their range as prices move.

Formula

Constant Product: x × y = k
Price of X in terms of Y: P_x = y / x
Impermanent Loss: IL = 2√r/(1+r) - 1, where r = price_final / price_initial
Price impact: ΔP/P ≈ ΔQ / (2 × pool_depth)

Example

A DeFi arbitrageur monitors the ETH/USDC pool on Uniswap v2 and the ETH spot price on Coinbase. The Uniswap pool has reserves of 10,000 ETH and 19,000,000 USDC (k = 190,000,000,000), implying an ETH price of $1,900. Coinbase ETH is trading at $1,950. The arbitrageur buys ETH from Uniswap: to acquire ETH, they sell USDC until the pool price reaches $1,950. Setting (10,000 - x)² × $1,950 = 190,000,000,000 × 1,950 / 10,000² gives approximately 127 ETH purchased for approximately 244,050 USDC, a cost of ~$1,922 per ETH (with slippage). The arbitrageur sells the 127 ETH on Coinbase at $1,950, earning approximately $3,600 profit minus gas fees. This arbitrage restores pool price alignment with the broader market—demonstrating how AMMs maintain price efficiency through open arbitrage rather than human market makers.

Related terms

Arbitrage Blockchain Crypto Derivatives Decentralized Exchange Defi Decentralized Finance Exchange Exchange Rate Funding Rate Liquidity Liquidity Pool Market Impact Market Maker