Constant Product Invariant
The Constant Product Invariant is the fundamental mathematical rule used by many automated market makers to determine asset pricing. It dictates that the product of the quantities of two tokens in a liquidity pool must remain constant during a trade, represented by the formula x times y equals k.
This mechanism ensures that as one asset is removed from the pool, the other must be added, automatically adjusting the price based on supply and demand. The formula creates a curved price function, which inherently allows for trades of any size while theoretically never reaching zero liquidity.
It provides a simple, robust framework for decentralized exchange operations that does not require an external price feed. However, it can lead to high slippage for large orders, necessitating the development of more complex variations for stablecoins or correlated assets.