Skip to main content

What Role Does the “K” Constant Play in the Constant Product Market Maker Formula?

In the x y=k formula, the constant "k" represents the product of the two token reserves (x and y) and is a measure of the pool's total liquidity. The value of k must remain unchanged after any trade, ensuring that the pool's invariant is maintained.

This invariant is the core mechanism that dictates the price curve and the relative amounts of tokens a trader receives. A larger k generally indicates a deeper pool, leading to less price impact for a given trade size.

What Is the Primary Mathematical Formula Used by AMMs to Maintain Pool Balance?
How Can an Invariant Be Checked during a Unit Test?
How Do Hybrid AMM Models, like Curve’s StableSwap Invariant, Improve upon the Constant Product Formula for Stablecoin Trading?
How Does the Constant Product Formula X Y = K Mathematically Dictate the Price in a Liquidity Pool?