Constant Product Curve (xy = k)
The constant product formula maintains liquidity invariance through the following relationships:Invariant Formula
Liquidity Invariant (D)
Stable Swap Curve (StableSwap)
Implements Curve Finance’s StableSwap algorithm via Saber StableSwap.Core StableSwap Invariant
Where:A= amplification coefficientn= number of tokens (2 for pairs)x_i= token amountsD= invariant
Fee Calculation Formulas
Trading Fees
Base Trading Fee
Where:fee_denominator= 100,000

