Skip to main content
Version: 3.0.0

TickMath

Properties#

MAX_SQRT_RATIO#

Static MAX_SQRT_RATIO: default

The sqrt ratio corresponding to the maximum tick that could be used on any pool.

Defined in: utils/tickMath.ts:35


MAX_TICK#

Static MAX_TICK: number= -TickMath.MIN_TICK

The maximum tick that can be used on any pool.

Defined in: utils/tickMath.ts:26


MIN_SQRT_RATIO#

Static MIN_SQRT_RATIO: default

The sqrt ratio corresponding to the minimum tick that could be used on any pool.

Defined in: utils/tickMath.ts:31


MIN_TICK#

Static MIN_TICK: number= -887272

The minimum tick that can be used on any pool.

Defined in: utils/tickMath.ts:22

Methods#

getSqrtRatioAtTick#

Static getSqrtRatioAtTick(tick: number): default

Returns the sqrt ratio as a Q64.96 for the given tick. The sqrt ratio is computed as sqrt(1.0001)^tick

Parameters#

NameTypeDescription
ticknumberthe tick for which to compute the sqrt ratio

Returns: default

Defined in: utils/tickMath.ts:41


getTickAtSqrtRatio#

Static getTickAtSqrtRatio(sqrtRatioX96: default): number

Returns the tick corresponding to a given sqrt ratio, s.t. #getSqrtRatioAtTick(tick) <= sqrtRatioX96 and #getSqrtRatioAtTick(tick + 1) > sqrtRatioX96

Parameters#

NameTypeDescription
sqrtRatioX96defaultthe sqrt ratio as a Q64.96 for which to compute the tick

Returns: number

Defined in: utils/tickMath.ts:82