🦄 Uniswap vs 🔵 Curve
The two dominant DEX designs in DeFi take fundamentally different approaches to automated market making. Uniswap's constant-product formula (x×y=k) is a general-purpose workhorse. Curve's StableSwap invariant is purpose-built for pegged assets. Here we visualize both curves, simulate price impact, and break down when each design wins.
📊 At a Glance
📐 AMM Curve Comparison — Interactive
Two bonding curves overlaid. Drag the amplification slider to morph Curve's StableSwap from constant-product (A=1) toward constant-sum (high A). At A=1 both curves overlap; at A=200 Curve's line is nearly flat near the peg.
💥 Price Impact Simulator
Adjust the trade size relative to the pool, and toggle between volatile and stablecoin pairs. Curve's StableSwap dominates for pegged assets; Uniswap V3 concentrated liquidity is competitive for volatile pairs.
🦄 How x×y = k Works
Uniswap's constant-product formula is elegantly simple. A pool holds reserves of two tokens (x and y). Their product must always equal a constant k:
When a trader swaps dx of token X into the pool, the new reserves become (x + dx) and y'. The invariant gives us:
The trader receives y − y' tokens. Because this is a hyperbola, larger trades move the price further along the curve, creating slippage proportional to trade size relative to reserves. A 1% pool trade yields roughly 1% price impact; 10% yields roughly 10%.
Uniswap V3: Concentrated Liquidity
V3 lets LPs concentrate their capital within specific price ranges. Instead of spreading liquidity from 0 to infinity, an LP providing liquidity between prices pa and pb acts like a much larger V2 position. This multiplies effective depth by up to 4000x for tight ranges, dramatically reducing price impact for trades within that range. The trade-off: if the price moves outside the LP's range, they earn zero fees and hold 100% of the depreciating asset.
🔵 How StableSwap Works
Curve's StableSwap invariant is a hybrid between constant-sum (x + y = D, zero slippage) and constant-product (x × y = (D/2)², Uniswap-like). The full invariant for n=2 tokens:
The amplification parameter A controls the blend:
- A = 0: Behaves exactly like Uniswap's constant-product curve
- A → ∞: Approaches constant-sum (x + y = D), meaning near-zero slippage
- Typical A: 50–200 for stablecoin pools, creating a flat region near the peg where trades have minimal impact
This is why Curve dominates for stablecoin swaps. Near parity (USDC ≈ USDT ≈ 1.00), the curve is nearly flat — meaning massive trades create almost no slippage. But if the peg breaks, the curve steepens rapidly to protect LPs from total loss.
Why Not Use High-A for Everything?
A high amplification parameter assumes the assets should be priced equally. For volatile pairs like ETH/USDC, a high A would cause catastrophic losses during price movements. Curve V2 introduced a "crypto-pool" invariant that dynamically adjusts the concentration point, but Uniswap V3 concentrated liquidity remains more flexible for volatile pairs.
⚖️ When Each DEX Wins
🏆 The Verdict
- You're trading volatile pairs (ETH/USDC, WBTC/ETH)
- You want to LP with custom price ranges
- You're listing or trading long-tail tokens
- You want composable NFT LP positions
- You need the deepest liquidity on the most chains
- You're swapping stablecoins (USDC ↔ USDT ↔ DAI)
- You're trading liquid staking derivatives (stETH ↔ ETH)
- You want governance yield via veCRV locking
- You need multi-asset pool swaps
- You're building on top of the Curve gauge/bribe ecosystem