What Is the Formula Used by a Constant Product AMM (E.g. Uniswap V2)?
The constant product formula is x y = k, where x and y are the quantities of the two tokens in the pool, and k is a constant. This formula ensures that the product of the reserves remains unchanged after a trade, meaning that as one token is bought, the price of the remaining token increases, maintaining a balance and providing continuous liquidity.
Glossar
Constant Product AMM
Mechanism ⎊ A Constant Product Automated Market Maker (CPAMM) represents a decentralized exchange protocol fundamentally reliant on the equation xy=k, where x and y denote the quantities of two tokens within a liquidity pool, and k remains constant during trades.
Constant Sum Formula
Mechanism ⎊ The Constant Sum Formula, sometimes employed in specialized stablecoin AMMs, dictates that the sum of the reserves ($x + y = k$) remains fixed, implying a constant marginal price of one-to-one regardless of the trade size.
Constant Product Formula
Formula ⎊ The Constant Product Formula, a cornerstone of Automated Market Makers (AMMs) like Uniswap, dictates the relationship between the reserves of two tokens within a liquidity pool.
Constant Product
Invariant ⎊ The core principle dictates that the product of the quantities of the two assets in a liquidity pool remains constant, represented mathematically as $x cdot y = k$, where $x$ and $y$ are the reserves of the two tokens.