A stable-swap invariant shapes liquidity around an expected relationship between correlated assets. It can keep the exchange curve relatively flat near balance while allowing prices to adjust more strongly as the pool becomes imbalanced. It does not guarantee that either asset maintains its external peg.
Why a permanently flat curve is insufficient
In a hypothetical constant-sum pool, x + y stays fixed and one unit of A exchanges for one unit of B while inventory lasts. If the pool has 100 B available, it cannot continue supplying B indefinitely at that rate. A flat rule can run out of one side.
Constant product adjusts the rate progressively as reserves shift. That supports a broader range of relative prices, but it can make the curve less flat than desired around the expected relationship of strongly correlated assets.
The hybrid idea
Curve's original StableSwap paper develops a middle-ground invariant with near-balance behavior closer to constant sum and stronger curvature away from balance. Balancer's stable-math documentation identifies balances, amplification and trade amount as inputs to pricing.
The amplification parameter influences the curve's shape. It should not be read as a guarantee of a fixed market price or a universal multiplier of usable reserves. Normalization and asset-rate conventions also matter in real implementations.
What a swapper should infer
A stable pool can quote efficiently for some correlated trades, especially near its intended balance. If one asset becomes scarce or diverges in external value, the amount-dependent quote remains decisive. The category name does not make a large trade equivalent to a redemption at par.
For a hypothetical pair of dollar-referenced assets, “both target one dollar” is not enough to assume one-for-one execution. Pool balance, fees, amount and asset quality remain separate considerations.
A router must use the pool's actual invariant and current state. Substituting a constant-product formula or multiplying a tiny quote by a large size can misrepresent the available output. Stable-swap math changes the shape of liquidity; it does not remove the need to calculate the complete trade.
Sources & verification (2)
Source-check date is recorded in the article details. URLs are provided for manual verification. Use Copy to keep this page open.
- StableSwap - efficient mechanism for Stablecoin liquidity
Hybrid invariant behavior between constant-sum and constant-product; amplification.
https://curve.fi/files/stableswap-paper.pdf - Stable Math | Balancer
Stable invariant combines constant-sum and constant-product behavior.
https://docs.balancer.fi/concepts/explore-available-balancer-pools/stable-pool/stable-math.html