Skip to main content
Helpful?

TickMath

@uniswap/v3-sdk / Exports / TickMath

Class: TickMath

Table of contents​

Constructors​

Properties​

Methods​

Constructors​

constructor​

• Private new TickMath()

Cannot be constructed.

Defined in​

utils/tickMath.ts:17

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): 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): 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

Helpful?