TickListDataProvider

Provides information about ticks in a fixed list that is created upon class instantiation.

GitHub File: tickListDataProvider.ts

Properties

Private

PropertyTypeModifierDescription

ticks

readonly

Array of ticks, each with information on the tick index and liquidity values associated with the tick.

Constructor

Parameters

ParamsTypeDescription

ticks

Array of ticks, each with information on the tick index and liquidity values associated with the tick.

tickSpacing

number

The tick spacing. Used to validate correct tick spacing and check pool liquidity against the total net liquidity across ticks.

Methods

getTick() - async

Returns the liquidity data of the tick index provided.

Parameters

ParamsTypeDescription

tick

number

The tick index to query.

Returns

TypeDescription

Promise<{ liquidityNet: BigintIsh; liquidityGross: BigintIsh }>

The liquidityNet and liquidityGross values for the tick index passed.


nextInitializedTickWithinOneWord() - async

Searches the current and neighbouring words and returns the next initialized tick.

Parameters

ParamsTypeDescription

tick

number

The tick index to query.

lte

boolean

Less than or equal to the starting tick. This determines whether to search for the next initialized tick to the left of the current tick.

tickSpacing

number

The spacing between usable ticks.

Returns

TypeDescription

number

The next initialized tick up to 256 ticks away from the current active tick. If the next initialized tick is not within ±256 ticks, the value returned will be the last uninitialized tick from the current active tick (currentTick - 256 OR currentTick + 256).

boolean

true = The tick number returned is initialized. false = The tick number returned is uninitialized.


nextInitializedTickWithinFixedDistance() - async

Searches for the next initialized tick up to the distance specified.

Parameters

ParamsTypeDescription

tick

number

The tick index to query.

lte

boolean

Less than or equal to the starting tick. This determines whether to search for the next initialized tick to the left of the current tick.

distance

number

The distance from the current active tick to search. Default is 480.

Returns

TypeDescription

number

The next initialized tick up to the distance specified from current active tick. If the next initialized tick is not within the distance specified, the value returned will be the last uninitialized tick from the current active tick (currentTick - distance OR currentTick + distance).

boolean

true = The tick number returned is initialized. false = The tick number returned is uninitialized.

Last updated