Skip to main content

How Is the ‘K’ Constant Maintained When a Trade Occurs in the Pool?

The 'k' constant is maintained by the trade itself. When a user deposits token X and withdraws token Y, the pool's reserve of X increases and the reserve of Y decreases.

The formula $x times y = k$ ensures that the product of the new, adjusted reserves of X and Y, minus the fees taken from the trade, equals the original 'k'. The fee is usually added back to the pool to slightly increase 'k' over time.

How Does the Constant Product Formula (X Y=k) Govern the Price within a Liquidity Pool?
How Does a ‘Hybrid AMM’ (Like Curve’s Stableswap) Combine Features of Constant Product and Constant Sum?
Under What Specific Condition Would the Value of a European Option Equal That of an American Option?
Is It Possible for a Dark Pool Price to Be Significantly Better than the Public Exchange Price?