@gala-chain/api ∙ API
API > TickData
Class: TickData
Contents
- Extends
- Constructors
- new TickData(poolHash, tick)
- Properties
- feeGrowthOutside0
- feeGrowthOutside1
- initialised
- liquidityGross
- liquidityNet
- poolHash
- tick
- COMPOSITEKEY_NS
- ID_SPLIT_CHAR
- ID_SUB_SPLIT_CHAR
- INDEX_KEY
- MAX_TICK
- MIN_TICK
- MIN_UNICODE_RUNE_VALUE
- Methods
- getCompositeKey()
- serialize()
- tickCross()
- toPlainObject()
- updateTick()
- validate()
- validateOrReject()
- decodeFromBase58()
- deserialize()
- encodeToBase58()
- getCompositeKeyFromParts()
- getEncodableStringKeyFromParts()
- getPartsFromEncodableStringKey()
- getStringKeyFromParts()
Extends
Constructors
new TickData(poolHash, tick)
new TickData(
poolHash,tick):TickData
Parameters
▪ poolHash: string
▪ tick: number
Overrides
Source
chain-api/src/types/TickData.ts:67
Properties
feeGrowthOutside0
feeGrowthOutside0:
BigNumber
Source
chain-api/src/types/TickData.ts:61
feeGrowthOutside1
feeGrowthOutside1:
BigNumber
Source
chain-api/src/types/TickData.ts:65
initialised
initialised:
boolean
Source
chain-api/src/types/TickData.ts:53
liquidityGross
liquidityGross:
BigNumber
Source
chain-api/src/types/TickData.ts:50
liquidityNet
liquidityNet:
BigNumber
Source
chain-api/src/types/TickData.ts:57
poolHash
readonlypoolHash:string
Source
chain-api/src/types/TickData.ts:40
tick
readonlytick:number
Source
chain-api/src/types/TickData.ts:46
COMPOSITEKEY_NS
staticCOMPOSITEKEY_NS:string="\x00"
Inherited from
Source
chain-api/src/types/ChainObject.ts:46
ID_SPLIT_CHAR
staticID_SPLIT_CHAR:string="$"
Inherited from
Source
chain-api/src/types/ChainObject.ts:49
ID_SUB_SPLIT_CHAR
staticID_SUB_SPLIT_CHAR:string="|"
Inherited from
Source
chain-api/src/types/ChainObject.ts:51
INDEX_KEY
staticINDEX_KEY:string="GCDEXCHTD"
Source
chain-api/src/types/TickData.ts:26
MAX_TICK
staticMAX_TICK:number=887272
Source
chain-api/src/types/TickData.ts:36
MIN_TICK
staticMIN_TICK:number=-887272
Source
chain-api/src/types/TickData.ts:31
MIN_UNICODE_RUNE_VALUE
staticMIN_UNICODE_RUNE_VALUE:string="\u0000"
Inherited from
ChainObject.MIN_UNICODE_RUNE_VALUE
Source
chain-api/src/types/ChainObject.ts:44
Methods
getCompositeKey()
getCompositeKey():
string
Inherited from
Source
chain-api/src/types/ChainObject.ts:80
serialize()
serialize():
string
Inherited from
Source
chain-api/src/types/ChainObject.ts:53
tickCross()
tickCross(
feeGrowthGlobal0,feeGrowthGlobal1):BigNumber
Updates the fee growth outside values based on current global fee growth and returns the net liquidity.
Parameters
▪ feeGrowthGlobal0: BigNumber
The global fee growth for token0.
▪ feeGrowthGlobal1: BigNumber
The global fee growth for token1.
Returns
The net liquidity after updating fee growth values.
Source
chain-api/src/types/TickData.ts:139
toPlainObject()
toPlainObject():
Record\<string,unknown>
Inherited from
Source
chain-api/src/types/ChainObject.ts:69
updateTick()
updateTick(
tickCurrent,liquidityDelta,upper,feeGrowthGlobal0,feeGrowthGlobal1,maxLiquidity):boolean
Updates the tick's liquidity and initialization state.
- Adjusts liquidity gross and net based on the delta and direction (upper/lower).
- Initializes the tick if it's being used for the first time.
- If initializing and tick is below or at the current price, sets fee growth outside.
- Returns
trueif the tick was just initialized or its state flipped on/off.
Parameters
▪ tickCurrent: number
The current active tick index in the pool.
▪ liquidityDelta: BigNumber
The amount of liquidity to add or remove.
▪ upper: boolean
Whether this tick is the upper tick of a position.
▪ feeGrowthGlobal0: BigNumber
Global fee growth for token0.
▪ feeGrowthGlobal1: BigNumber
Global fee growth for token1.
▪ maxLiquidity: BigNumber
The maximum allowed liquidity for a tick.
Returns
true if the tick was initialized or flipped, else false.
Source
chain-api/src/types/TickData.ts:95
validate()
validate():
Promise\<ValidationError[]>
Inherited from
Source
chain-api/src/types/ChainObject.ts:57
validateOrReject()
validateOrReject():
Promise\<void>
Inherited from
Source
chain-api/src/types/ChainObject.ts:61
decodeFromBase58()
staticdecodeFromBase58(base58String):string
Parameters
▪ base58String: string
Inherited from
Source
chain-api/src/types/ChainObject.ts:142
deserialize()
staticdeserialize\<T>(constructor,object):T
Type parameters
▪ T
Parameters
▪ constructor: ClassConstructor\<Inferred\<T, ChainObject>>
▪ object: string | Record\<string, unknown> | Record\<string, unknown>[]
Inherited from
Source
chain-api/src/types/ChainObject.ts:73
encodeToBase58()
staticencodeToBase58(stringKey):string
Parameters
▪ stringKey: string
Inherited from
Source
chain-api/src/types/ChainObject.ts:137
getCompositeKeyFromParts()
staticgetCompositeKeyFromParts(indexKey,parts):string
Parameters
▪ indexKey: string
▪ parts: unknown[]
Inherited from
ChainObject.getCompositeKeyFromParts
Source
chain-api/src/types/ChainObject.ts:105
getEncodableStringKeyFromParts()
staticgetEncodableStringKeyFromParts(parts):string
Parameters
▪ parts: string[]
Inherited from
ChainObject.getEncodableStringKeyFromParts
Source
chain-api/src/types/ChainObject.ts:129
getPartsFromEncodableStringKey()
staticgetPartsFromEncodableStringKey(stringKey):string[]
Parameters
▪ stringKey: string
Inherited from
ChainObject.getPartsFromEncodableStringKey
Source
chain-api/src/types/ChainObject.ts:133
getStringKeyFromParts()
staticgetStringKeyFromParts(parts):string
Parameters
▪ parts: string[]
Inherited from
ChainObject.getStringKeyFromParts