AMM Invariants
AMM invariants are the mathematical rules that govern the state of a liquidity pool, ensuring that it remains balanced and functional during trades. The most common invariant is the constant product, but others exist, such as the constant sum or stableswap formulas.
These invariants define the relationship between the assets in the pool, ensuring that every trade follows a predictable and transparent price curve. They are the fundamental laws of the protocol, embedded directly into the smart contract code.
Because they are immutable and transparent, they provide trust to all participants. Invariants prevent the pool from being drained and ensure that there is always liquidity available for traders.
Understanding these invariants is key to analyzing the behavior of different DeFi protocols and assessing their stability. They are the bedrock of algorithmic market making.
As the ecosystem matures, new and more efficient invariants are being developed to support a wider range of assets and trading strategies. They represent the intersection of advanced mathematics and financial engineering.