KyberSwap Docs
Search
K

TickListDataProvider

Provides information about ticks in a fixed list that is created upon class instantiation.
GitHub File: tickListDataProvider.ts

Properties

Private

Property
Type
Modifier
Description
ticks
Tick[]
readonly
Array of ticks, each with information on the tick index and liquidity values associated with the tick.

Constructor

Parameters

Params
Type
Description
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

Params
Type
Description
tick
number
The tick index to query.

Returns

Type
Description
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

Params
Type
Description
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

Type
Description
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

Params
Type
Description
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

Type
Description
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 modified 5mo ago