Price Calculation Formulas
Base Price Formula
Where:BASIS_POINT_MAX
= 10,000- Uses Q64.64 fixed-point arithmetic
- Example: For
bin_step = 10
,price = (1.001)^active_id
Price Impact Formulas
Selling X for Y: Selling Y for X:Fee Calculation Formulas
Total Trading Fee
Base Fee Formula
Variable Fee Formula
Where:OFFSET
= 99,999,999,999SCALE
= 100,000,000,000
Composition Fee Formula
Where:MAX_FEE_RATE
= 100,000,000
Liquidity and Bin Math Formulas
Liquidity Formula (Constant Sum)
Where:L
is liquidityx
andy
are token amounts- Price is in Q64.64 format