Functionsยง
- decode_
sqrt_ price_ x96_ to_ price - Converts a sqrt price X96 to a raw Price (token1/token0 ratio without decimal adjustment).
- decode_
sqrt_ price_ x96_ to_ price_ tokens_ adjusted - Converts a sqrt price X96 to a human-readable spot price adjusted for token decimals.
- encode_
sqrt_ ratio_ x96 - Encodes the sqrt ratio of two token amounts as a Q64.96 fixed point number.
- expand_
to_ 18_ decimals - Expands an amount to 18 decimal places (multiplies by 10^18).
- get_
amount0_ delta - Calculates the amount of token0 delta between two sqrt price ratios.
- get_
amount1_ delta - Calculates the amount of token1 delta between two sqrt price ratios.
- get_
amounts_ for_ liquidity - Calculates the token amounts required for a given liquidity position.
- get_
next_ sqrt_ price_ from_ input - Calculates the next sqrt price given an input amount.
- get_
next_ sqrt_ price_ from_ output - Calculates the next sqrt price given an output amount.