What is StableSwap, and how does it differ from the constant product formula used by general AMMs?
StableSwap is an automated-market-maker pricing algorithm invented by Curve Finance, purpose-built for asset pairs that are theoretically supposed to hold the same value — stablecoin pairs like USDC/USDT/DAI, or highly correlated assets like stETH/ETH. Unlike the constant product formula (x × y = k) used by general AMMs such as Uniswap, StableSwap blends a constant sum formula (x + y = D) together with the constant product formula, controlling the mix between the two through a parameter called the amplification coefficient (A).
The core difference: a constant product formula assumes relative prices between assets can swing widely with supply and demand — reasonable for a volatile pair like ETH/USDC. Applying that same formula to a stablecoin pair produces unnecessary price movement the moment pool ratios become even slightly imbalanced. StableSwap is mathematically optimized around the property that the assets should hold the same price, keeping the trading curve nearly flat across the critical range so large trades barely move the price.
Why did anyone bother inventing StableSwap instead of just using an off-the-shelf constant product formula?
Stablecoin trading volume in DeFi is enormous — Curve's 3pool alone can see $50–200 million in daily volume. If every large stablecoin swap had to absorb the high slippage a constant-product formula produces, that would be a persistent, substantial hidden cost for institutions, market makers, and any protocol that frequently rebalances positions — effectively forcing traders to pre-pay for volatility risk in a market that isn't supposed to have much volatility to begin with.
StableSwap's core reason for existing is eliminating that unnecessary cost. By recognizing that stablecoins are supposed to hold the same price, it mathematically flattens the trading curve across the critical range, so large trades only bear the risk that's actually real — the possibility of a genuine depeg — rather than paying for volatility that doesn't exist under normal market conditions. This is also why Curve has maintained market share and volume in stablecoin swaps far above general-purpose DEXs for years.
How does StableSwap actually work, and what role does the amplification coefficient play?
StableSwap's core formula blends the constant sum and constant product models onto a single curve: when pool balances are near equilibrium — each asset holding roughly equal share, both near $1 — the curve behaves close to a constant sum formula, nearly a flat line, meaning large trades barely move the price. Only when the pool becomes imbalanced past a safe range does the curve gradually shift back toward a constant-product shape, ensuring the algorithm still functions — rather than being drained in one direction — when assets genuinely diverge from their peg.
The amplification coefficient (A) is the key parameter controlling how wide that flat range stays: a higher A widens the flat range, letting the pool absorb larger trades without visibly moving off $1; a lower A causes the curve to start behaving like a constant product formula sooner. This parameter isn't fixed — it's set through Curve's DAO governance vote, and the major 3pool (USDC/USDT/DAI) currently runs A=2000. There was even a past governance proposal to raise A to 5000, which ultimately failed over concerns it would amplify risk during a depeg.
What does StableSwap mean for ordinary users, and what should you watch out for when using it?
For anyone regularly converting between stablecoins, StableSwap's practical benefit is dramatically lower slippage cost — the same $1 million USDC-to-USDT swap runs about 0.008% slippage (roughly $80) through a StableSwap venue like Curve's 3pool, versus potentially 0.127% or more (over $1,200) through a general AMM pool. Most aggregators (1inch, Matcha, CoW Swap) automatically route to StableSwap pools, so ordinary users don't need to compare manually, but understanding the mechanism helps in reading unusual signals.
One thing worth watching: StableSwap's low slippage rests on the assumption that assets hold their peg — an assumption that holds under normal conditions but is most fragile exactly during a crisis. During the March 2023 Silicon Valley Bank crisis, USDC briefly traded near $0.88 on some venues, and StableSwap's amplification coefficient lost its ability to suppress the price deviation, sharply widening slippage. If you see slippage on a stablecoin swap suddenly running far higher than usual, that's usually not simple illiquidity — it often means the market has already started pricing in depeg risk for one of the assets, worth investigating before pushing through the elevated cost.
On the same $1 million USDC-to-USDT swap, Curve's 3pool (running StableSwap, A=2000) produces roughly 0.008% slippage — about $80 — while executing the identical trade through a Uniswap V3 general pool runs roughly 0.127% slippage, over $1,200 — a difference of more than 10x.
StableSwap's advantage is dramatically lowering slippage cost for swaps between assets that should hold the same value under normal conditions, keeping real-world costs on large stablecoin trades far below general AMMs; the drawback is that this optimization rests entirely on the assumption that the assets should be worth the same — once an asset genuinely depegs, the amplification coefficient rapidly loses effectiveness, and slippage can widen even more sharply than on a general AMM, because the volatility risk the pool had been compressing gets released all at once.