Constant Function Market Maker

Algorithm

A constant function market maker functions as a decentralized trading mechanism that replaces traditional limit order books with a deterministic mathematical curve. By maintaining a specific invariant, such as the product of two reserve assets, this protocol enables autonomous price discovery and liquidity provision without requiring a central counterparty. Traders interact directly with the smart contract, which computes the required input or output amounts based on the predefined function to ensure the pool balance remains consistent.