TickMath
Overview
License: GPL-2.0-or-later
Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports prices between 2**-128 and 2**128
Functions info
getSqrtRatioAtTick
Calculates sqrt(1.0001^tick) * 2^96
Throws if |tick| > max tick
Parameters:
Return values:
getTickAtSqrtRatio
Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio
Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may ever return.
Parameters:
Return values:
Last updated