The Constant Product Formula

In the world of decentralized finance (DeFi), the Constant Product Formula is the foundation of most automated market makers (AMMs), including Uniswap, PancakeSwap, and others. This simple yet powerful formula governs how token prices are determined without the need for traditional order books.


πŸ“ What Is the Constant Product Formula?

The formula is written as:

X Γ— Y = K

  • X = amount of Token A in the liquidity pool

  • Y = amount of Token B (often USD or stablecoin)

  • K = constant value that must remain unchanged

As traders buy or sell tokens, the quantities of X and Y adjust. But no matter what, the product of the two remains constant.


πŸ“ˆ How It Works in Practice

When someone buys Token A (reducing X), they must add more of Token B (increasing Y) to keep K constant. This causes the price of Token A to increase.

The reverse happens when someone sells Token A β€” the price decreases as more of it enters the pool.

This creates a hyperbolic price curve where small trades cause minor price changes, but larger trades cause steeper price shifts. As the pool becomes more imbalanced, the cost to continue trading rises significantly.


🧠 Why It Matters

  • Price Discovery: The formula creates a natural pricing mechanism based on supply and demand.

  • Liquidity Efficiency: It allows any token pair to be traded as long as there’s liquidity.

  • Transparency: Anyone can inspect the math β€” it’s open and permissionless.

Understanding this formula is critical for:

  • Token founders modeling launch strategies

  • Investors evaluating token volatility

  • Anyone trying to predict how price changes with each trade


πŸ” Visualizing the Curve

The Constant Product Formula doesn’t create a straight line β€” it generates a curve that steepens as supply decreases. That’s where tools like RatioLock’s Hyperbolic Curve Simulator come in.

You can visually experience how prices accelerate when a token is heavily bought and how that aligns with AMM dynamics.


πŸ“Š Explore Further

Use our interactive tools to:

  • Simulate price targets and slippage

  • Reverse-calculate market cap and supply

  • Understand how much USD is needed to move the market

RatioLock helps you see the curve β€” not just the price.