TickMath

Contains the math to compute corresponding ticks and square root ratios (i.e. price).

GitHub File: tickMath.ts

Properties

Public

PropertyTypeModifierDescription

MIN_TICK

number

static

The minimum tick of the pool.

MAX_TICK

number

static

The maximum tick of the pool.

MIN_SQRT_RATIO

static

The square root ratio (i.e. price) corresponding to the minimum tick.

MAX_SQRT_RATIO

static

The square root ratio (i.e. price) corresponding to the maximum tick.

Constructor

Private constructor that cannot be constructed.

Methods

getSqrtRatioAtTick() - public static

Computes the square root ratio (i.e. price) at the specified tick.

Parameters

ParamsTypeDescription

tick

number

The tick for which to compute the price.

Returns

TypeDescription

The square root ratio at the specified tick.


getTickAtSqrtRatio() - public static

Computes the tick corresponding to the specified square root ratio (i.e. price).

Parameters

ParamsTypeDescription

sqrtRatioX96

The square root ratio (i.e. price) at which to calculate the corresponding tick.

Returns

TypeDescription

The tick corresponding to the square root ratio.

Last updated