CFMM

Algorithm

Constant Function Market Makers (CFMMs) represent a deterministic approach to automated market making, fundamentally differing from traditional order book exchanges through reliance on mathematical formulas to price assets. These algorithms utilize liquidity pools funded by users, establishing a price curve based on the ratio of assets within the pool, and facilitating trades directly against this curve. The core principle involves maintaining an invariant, ensuring that the total value of assets remains constant before and after a trade, thereby determining the price impact. Consequently, CFMMs offer continuous liquidity, albeit with potential for slippage dependent on trade size relative to pool depth.