Curve Finance Explained: How the StableSwap AMM Works
How Curve's StableSwap invariant minimizes slippage for like-pegged assets, and why it differs from a standard constant-product AMM.
Curve Finance is a decentralized exchange built around the StableSwap invariant, a mathematical formula specifically designed to minimize price slippage when swapping between assets that are meant to trade near the same value — like two different stablecoins, or staked and unstaked versions of the same underlying asset.
This narrow focus is deliberate, and it's what distinguishes Curve from a general-purpose AMM like Uniswap. Curve isn't trying to efficiently price arbitrary, unrelated asset pairs — it's trying to make swaps between assets that should already be worth roughly the same amount as close to costless as possible.
Why a standard constant-product formula struggles with stable pairs
Uniswap's classic x × y = k constant-product formula treats every pair the same way regardless of how correlated the two assets are expected to be. For a volatile pair, that's appropriate — the curve needs to reflect the possibility of significant price divergence. But for two assets that are both pegged to the same value (say, two different USD stablecoins), a constant-product curve still applies meaningful slippage well before the pool is anywhere close to imbalanced, because the formula doesn't "know" the assets are supposed to be equivalent.
How the StableSwap invariant fixes this
The StableSwap formula blends a constant-sum curve (which offers zero slippage but breaks down and can be fully drained if the two assets ever diverge meaningfully in value) with a constant-product curve (which never fully depletes either asset but imposes more slippage). Near the point where a pool's two assets are roughly balanced — the expected, common case for correctly-pegged stablecoins — the formula behaves almost like the flat, zero-slippage constant-sum curve, letting large trades execute with very little price impact. As a pool becomes more imbalanced, though, the formula progressively shifts to behave more like the safer constant-product curve, which prevents a single large trade from fully draining one side of the pool even in a stress scenario.
This is why Curve pools can offer meaningfully tighter pricing for large stablecoin swaps than a generic constant-product pool of the same size — the formula is specifically shaped around the assumption that both assets normally trade near parity, while retaining a safety mechanism if that assumption temporarily breaks (during a stablecoin depeg event, for example).
What Curve pools are typically used for
- Stablecoin swaps. Moving between USDC, USDT, DAI/USDS, and similar assets with minimal slippage — useful for large trades, arbitrage, and as a routing hop for other protocols.
- Liquid staking derivative pairs. Pools pairing a staked asset (like a liquid staking token) with its unstaked underlying — see our liquid staking explainer — benefit from the same low-slippage design, since these pairs are also expected to trade near a consistent ratio (accounting for accrued staking rewards) rather than fluctuating independently.
- Wrapped asset pairs. Similar logic applies to wrapped versions of the same underlying asset across different standards or bridges.
Comparing the two curve types
| Feature | Constant-product (Uniswap-style) | StableSwap (Curve-style) |
|---|---|---|
| Best suited for | Volatile, uncorrelated pairs | Like-pegged or highly correlated pairs |
| Slippage near balance | Present even for small trades | Very low near the expected peg ratio |
| Behavior if assets diverge | Gradual, predictable slippage increase | Shifts toward constant-product behavior for safety |
| Typical LP fee | Often higher (0.3%+ common) | Often lower, reflecting lower risk for correlated pairs |
Risks specific to Curve-style pools
The main risk that's distinctive to StableSwap-style pools is a depeg event — if one of the paired assets loses its peg meaningfully (a stablecoin trading well below $1, for instance), the pool's formula will still let trades execute, but LPs can end up holding a disproportionate share of the weaker asset as arbitrageurs sell it into the pool, chasing the better relative pricing StableSwap offers near the peg. This is a variant of the same impermanent loss concept that applies to any AMM, but it manifests differently — as concentration risk in the depegging asset rather than a smooth divergence — because of how the curve is shaped.
Curve's broader ecosystem: veCRV and gauge voting
Beyond the AMM itself, Curve is also known for its vote-escrowed governance token model (veCRV), where locking CRV tokens for a chosen duration grants voting power over which pools receive CRV emissions ("gauge weight" votes) along with a share of protocol fees. This system has been influential across DeFi, spawning an entire secondary ecosystem of protocols built around accumulating and directing veCRV voting power — a topic broader than this piece, but worth knowing exists if you see CRV, veCRV, or "vote markets" referenced elsewhere.
How Curve compares to Uniswap directly
Choosing between Curve and Uniswap for a given trade or LP decision comes down to how correlated the asset pair is — see our direct Uniswap vs. Curve comparison for a fuller side-by-side breakdown of which AMM model fits which situation.
Bottom line
Curve's StableSwap invariant is purpose-built to minimize slippage for assets that should trade near the same value, making it the more capital-efficient venue for large stablecoin or correlated-asset swaps compared to a generic constant-product AMM — but that efficiency depends on the peg assumption holding, and a real depeg event can leave liquidity providers concentrated in the weaker asset. Check current stablecoins peg data before assuming any specific pool's pricing reflects a stable, risk-free peg relationship.
Related articles
This article is for educational purposes only and is not financial advice. DeFi involves significant risk, including total loss of funds. Always do your own research.