How Do “Stableswap” AMMs Modify the $x Cdot Y = K$ Formula for Pegged Assets?
Stableswap AMMs, such as those used by Curve, utilize a hybrid formula that combines elements of both the constant product ($x cdot y = k$) and constant sum ($x+y=k$) models. The formula is designed to be very flat (like $x+y=k$) near the peg, resulting in extremely low slippage for trades between assets with similar values.
However, as the price deviates significantly from the peg, the curve transitions to behave more like the constant product model, ensuring the pool cannot be fully drained.