Constant Product Invariant

Formula

The constant product invariant is a fundamental mathematical formula, typically expressed as x y = k, where x and y represent the quantities of two different assets in a liquidity pool, and k is a constant product. This invariant ensures that as one asset is traded for another, the product of their reserves remains unchanged, assuming no fees or external additions. It forms the core pricing mechanism for many automated market makers (AMMs) in decentralized finance.