Koinlytics

Curve and the StableSwap Invariant

DeFi Protocolsintermediate7 min read
The AMM built specifically for assets that trade near 1:1. Why Curve dominates stablecoin swaps and why 3pool broke DeFi in 2022.

Uniswap's x*y=k works great for volatile assets but loses money on stables. If USDC and USDT are supposed to trade 1:1, a passive AMM that widens the spread as one side depletes wastes capital. Curve fixed this with a hybrid invariant.

The StableSwap invariant

Curve blends a constant sum (x+y=k, perfect for stables) with constant product (x*y=k, needed at extremes). Near the 1:1 peg, it behaves almost linearly, giving tight spreads and low slippage even for large trades. Only when balances get very lopsided does it start behaving like Uniswap.

Why it matters

Curve's 3pool (USDT/USDC/DAI) held billions in TVL and enabled swaps of $10M+ between stables with under 5 basis points of slippage. That level of liquidity is what makes stablecoin as a payment rail viable on-chain.

Cryptopools (Curve V2)

Extended the model to volatile-but-related pairs (BTC/ETH) with dynamic parameters that concentrate liquidity around the current price. Less efficient than Uniswap V3 for pure volatile pairs but strictly better for pairs that mean-revert.

The 2022 stress test

When UST depegged in May 2022, arbitrageurs drained UST out of Curve's 4pool, leaving other stables temporarily imbalanced. The system worked as designed: prices reflected reality, but a lot of LPs took losses because they were LPing what turned out to be an unbacked stablecoin.

Gauge wars and CRV emissions

Curve emits CRV to LPs, weighted by pool. Anyone who holds veCRV (vote-locked CRV, up to 4 years) can vote on which pools get more emissions. This started the "Curve wars": stablecoin issuers (Frax, Alchemix, Origin) buying and locking CRV to route emissions to their own pools, deepening liquidity for their tokens.

Where Curve fits in 2026

Still the deepest liquidity for pegged assets: LST/ETH pairs (stETH, rETH), LRT baskets, USDC/USDe/DAI. If you are swapping millions of stables and want tight execution, Curve is where you go.

PreviousUniswap V2 vs V3 vs V4 NextHow Aave Actually Works
Powered by Koinlytics · Free crypto education.

Ready to try what you just learned?

Open the Koinlytics dashboard and see the concepts live on your real portfolio.

Launch App