Liquidity Pool Invariant
The liquidity pool invariant is the mathematical rule that governs the relationship between assets in a decentralized exchange pool. It defines the state of the pool and ensures that the price changes consistently with trades.
The most common invariant is the constant product, but others exist, such as those for stablecoins that prioritize minimal slippage. The invariant determines how the pool behaves under different market conditions.
It is encoded directly into the smart contract, making it immutable and transparent. Understanding the specific invariant of a pool is crucial for predicting how a trade will affect the price.
It is the core logic that enables decentralized trading without an order book.