Skip to content

@gala-chain/apiAPI


API > sqrtPriceToTick

Function: sqrtPriceToTick()

sqrtPriceToTick(sqrtPrice): number

Parameters

sqrtPrice: BigNumber

The sqrt ratio for which to compute the tick

Returns

tick The greatest tick for which the ratio is less than or equal to the input ratio

Notice

Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio

Source

chain-api/src/utils/dex/tick.helper.ts:38