For the complete documentation index, see llms.txt. This page is also available as Markdown.

pool.gno

Burn

Burn removes liquidity from a position.

Halt check: reverts while the Withdraw halt scope is active.

Parameters

Name
Type
Description

cur

realm

Current realm context; callers use cross(cur) when crossing into this realm.

token0Path

string

Path of the first token in the pool pair.

token1Path

string

Path of the second token in the pool pair.

fee

uint32

Fee tier identifying the pool.

tickLower

int32

Lower inclusive tick boundary of the position range.

tickUpper

int32

Upper exclusive tick boundary of the position range.

liquidityAmount

string

Decimal liquidity amount to remove from the position.

positionCaller

address

Position-contract address whose position is decreased.

Return Values

Name
Type
Description

amount0

string

Token0 principal credited to the position, as a decimal string; the pool operation leaves it owed until a subsequent collection.

amount1

string

Token1 principal credited to the position, as a decimal string; the pool operation leaves it owed until a subsequent collection.

source

Collect

Collect pays tokens owed to a position out to recipient in full. No withdrawal fee is charged on this path; see CollectSwapFee for the fee-bearing path.

Halt check: reverts while the Withdraw halt scope is active.

Parameters

Name
Type
Description

cur

realm

Current realm context; callers use cross(cur) when crossing into this realm.

token0Path

string

Path of the first token in the pool pair.

token1Path

string

Path of the second token in the pool pair.

fee

uint32

Fee tier identifying the pool.

recipient

address

Non-zero address receiving the owed token amounts.

tickLower

int32

Lower inclusive tick boundary of the position range.

tickUpper

int32

Upper exclusive tick boundary of the position range.

amount0Requested

string

Decimal token0 amount requested from the position's accrued principal.

amount1Requested

string

Decimal token1 amount requested from the position's accrued principal.

Return Values

Name
Type
Description

amount0

string

Token0 principal transferred to recipient, as a decimal string.

amount1

string

Token1 principal transferred to recipient, as a decimal string.

source

CollectProtocol

CollectProtocol collects protocol fees from a pool.

Halt check: reverts while the Withdraw halt scope is active.

Parameters

Name
Type
Description

cur

realm

Current realm context; callers use cross(cur) when crossing into this realm.

token0Path

string

Path of the first token in the pool pair.

token1Path

string

Path of the second token in the pool pair.

fee

uint32

Fee tier identifying the pool.

recipient

address

Address receiving the collected protocol fees.

amount0Requested

string

Decimal token0 protocol-fee amount requested; collection is capped at the available amount.

amount1Requested

string

Decimal token1 protocol-fee amount requested; collection is capped at the available amount.

Return Values

Name
Type
Description

amount0

string

Token0 protocol fee transferred to recipient, as a decimal string.

amount1

string

Token1 protocol fee transferred to recipient, as a decimal string.

source

CollectSwapFee

CollectSwapFee pays accrued swap fees for a position out to recipient, net of the withdrawal fee.

Halt check: reverts while the Withdraw halt scope is active.

Parameters

Name
Type
Description

cur

realm

Current realm context; callers use cross(cur) when crossing into this realm.

token0Path

string

Path of the first token in the pool pair.

token1Path

string

Path of the second token in the pool pair.

fee

uint32

Fee tier identifying the pool.

recipient

address

Non-zero address receiving the collected token amounts after withdrawal-fee deduction.

tickLower

int32

Lower inclusive tick boundary of the position range.

tickUpper

int32

Upper exclusive tick boundary of the position range.

amount0Requested

string

Decimal token0 amount requested; the configured maximum value requests all token0 fees owed.

amount1Requested

string

Decimal token1 amount requested; the configured maximum value requests all token1 fees owed.

Return Values

Name
Type
Description

amount0

string

Collected token0 amount before withdrawal-fee deduction, as a decimal string.

amount1

string

Collected token1 amount before withdrawal-fee deduction, as a decimal string.

fee0

string

Withdrawal fee withheld from token0, as a decimal string.

fee1

string

Withdrawal fee withheld from token1, as a decimal string.

source

IncreaseObservationCardinalityNext

IncreaseObservationCardinalityNext increases the observation cardinality for a pool.

Halt check: reverts while the Pool halt scope is active.

Parameters

Name
Type
Description

cur

realm

Current realm context; callers use cross(cur) when crossing into this realm.

token0Path

string

Path of the first token in the pool pair.

token1Path

string

Path of the second token in the pool pair.

fee

uint32

Fee tier identifying the pool.

cardinalityNext

uint16

Requested maximum number of oracle observations retained for the pool.

source

Mint

Mint adds liquidity to a position.

Halt check: reverts while the Pool halt scope is active.

Parameters

Name
Type
Description

cur

realm

Current realm context; callers use cross(cur) when crossing into this realm.

token0Path

string

Path of the first token in the pool pair.

token1Path

string

Path of the second token in the pool pair.

fee

uint32

Fee tier identifying the pool.

tickLower

int32

Lower inclusive tick boundary of the position range.

tickUpper

int32

Upper exclusive tick boundary of the position range.

liquidityAmount

string

Decimal liquidity amount to add to the position.

positionCaller

address

Position-contract address whose position receives the liquidity.

Return Values

Name
Type
Description

amount0

string

Token0 amount required for the liquidity addition, as a decimal string.

amount1

string

Token1 amount required for the liquidity addition, as a decimal string.

source

NewDefaultFeeAmountTickSpacing

NewDefaultFeeAmountTickSpacing returns the default tick spacing for each supported fee tier.

Return Values

Name
Type
Description

map[uint32]int32

map[uint32]int32

fee-tier to tick-spacing mapping for 100, 500, 3000, and 10000 tiers.

source

NewPoolPositionsTree

NewPoolPositionsTree creates a BPTree for storing pool position info (fanout 16), owned by the pool domain realm so leaf-slot writes are not readonly tainted.

Return Values

Name
Type
Description

*bptree.BPTree

*bptree.BPTree

empty position storage tree with fanout 16.

source

NewPoolTicksTree

NewPoolTicksTree creates a BPTree for storing pool tick info (fanout 32), owned by the pool domain realm so leaf-slot writes are not readonly tainted.

Return Values

Name
Type
Description

*bptree.BPTree

*bptree.BPTree

empty tick storage tree with fanout 32.

source

NewPoolsTree

NewPoolsTree creates the BPTree used to store pools by pool path.

Return Values

Name
Type
Description

*bptree.BPTree

*bptree.BPTree

empty pool storage tree with fanout 32.

source

Types

Pool

Pool describes a single pool's state. A pool is identified with a unique key (token0, token1, fee), where token0 < token1.

source

Methods

BalanceToken0

BalanceToken0 returns the pool's current token0 balance.

Return Values

Name
Type
Description

int64

int64

token0 balance available in the pool.

source

BalanceToken1

BalanceToken1 returns the pool's current token1 balance.

Return Values

Name
Type
Description

int64

int64

token1 balance available in the pool.

source

Balances

Balances returns the pool's current token balances.

Return Values

Name
Type
Description

TokenPair

TokenPair

token0 and token1 balances tracked by the pool.

source

Clone

Clone copies a pool's own fields and leaves its collections nil: ticks, tickBitmaps, and positions are not copied. Oracle observations are stored separately from Pool.

The copy is shallow because the read-only pool view clones every entry a caller reads, so copying the collections would walk the whole tick tree for each entry on a page. Read them through their own lookups instead: GetTickInfo / GetInitializedTicksInRange for ticks, GetTickBitmaps for the bitmaps, GetPoolPositions for positions, and GetSlot0 / GetObservationAt for oracle metadata and entries. A caller that needs a working copy of a collection -- DrySwap is the only one -- assembles it from those getters.

Return Values

Name
Type
Description

*Pool

*Pool

shallow pool copy with scalar state and cloned numeric values; nil when the receiver is nil.

source

DeleteTick

DeleteTick removes the tick state for the given tick index.

Parameters

Name
Type
Description

tick

int32

tick index to remove.

source

DeleteTickBitmap

DeleteTickBitmap deletes the tick bitmap for the given word position.

Parameters

Name
Type
Description

wordPos

int16

signed bitmap word position to remove.

source

Fee

Fee returns the pool's fee tier.

Return Values

Name
Type
Description

uint32

uint32

fee tier used by swaps in this pool.

source

FeeGrowthGlobal0X128

FeeGrowthGlobal0X128 returns cumulative token0 fee growth per unit of liquidity.

Return Values

Name
Type
Description

*u256.Uint

*u256.Uint

token0 fee-growth accumulator scaled by 2^128.

source

FeeGrowthGlobal1X128

FeeGrowthGlobal1X128 returns cumulative token1 fee growth per unit of liquidity.

Return Values

Name
Type
Description

*u256.Uint

*u256.Uint

token1 fee-growth accumulator scaled by 2^128.

source

GetPosition

GetPosition returns the position information for key.

Parameters

Name
Type
Description

key

string

encoded lower/upper tick-range key to look up.

Return Values

Name
Type
Description

PositionInfo

PositionInfo

stored aggregate position for the key.

error

error

non-nil when the key is absent or contains a value of the wrong type.

source

GetTick

GetTick returns the state stored for a tick.

Parameters

Name
Type
Description

tick

int32

tick index to look up.

Return Values

Name
Type
Description

TickInfo

TickInfo

stored tick state.

error

error

non-nil when the tick is absent; a present value of the wrong type causes a panic.

source

HasTick

HasTick reports whether a tick entry exists in the pool's tick tree.

Parameters

Name
Type
Description

tick

int32

tick index to check.

Return Values

Name
Type
Description

bool

bool

true when the encoded tick is present; false otherwise.

source

IterateTicks

IterateTicks visits pool ticks in the inclusive range [startTick, endTick]. Iteration stops when the callback returns true.

Parameters

Name
Type
Description

startTick

int32

first tick index in the inclusive range.

endTick

int32

last tick index in the inclusive range.

fn

func(int32, TickInfo) bool

callback receiving each decoded tick and its state; return true to stop iteration.

source

Liquidity

Liquidity returns the pool's active liquidity for the current tick range.

Return Values

Name
Type
Description

*u256.Uint

*u256.Uint

active liquidity amount.

source

PoolPath

Pool Getters methods PoolPath returns the canonical pool path derived from token0, token1, and the fee tier.

Return Values

Name
Type
Description

string

string

pool identifier assembled from the pool's token paths and fee.

source

Positions

Positions returns the tree containing aggregate position state by range key.

Return Values

Name
Type
Description

*bptree.BPTree

*bptree.BPTree

pool position storage tree.

source

ProtocolFees

ProtocolFees returns protocol fees accrued in both pool tokens.

Return Values

Name
Type
Description

TokenPair

TokenPair

token0 and token1 protocol-fee balances.

source

ProtocolFeesToken0

ProtocolFeesToken0 returns protocol fees accrued in token0.

Return Values

Name
Type
Description

int64

int64

token0 amount reserved as protocol fees.

source

ProtocolFeesToken1

ProtocolFeesToken1 returns protocol fees accrued in token1.

Return Values

Name
Type
Description

int64

int64

token1 amount reserved as protocol fees.

source

SetBalanceToken0

SetBalanceToken0 updates the pool's tracked token0 balance.

Parameters

Name
Type
Description

token0

int64

new token0 balance.

source

SetBalanceToken1

SetBalanceToken1 updates the pool's tracked token1 balance.

Parameters

Name
Type
Description

token1

int64

new token1 balance.

source

SetBalances

SetBalances replaces the pool's tracked balances for both tokens.

Parameters

Name
Type
Description

balances

TokenPair

token0 and token1 balances to store.

source

SetFee

SetFee stores the pool's fee tier.

Parameters

Name
Type
Description

fee

uint32

fee tier to use for swaps in this pool.

source

SetFeeGrowthGlobal0X128

SetFeeGrowthGlobal0X128 stores the token0 fee-growth accumulator.

Parameters

Name
Type
Description

feeGrowthGlobal0X128

*u256.Uint

token0 fee growth per liquidity unit, scaled by 2^128.

source

SetFeeGrowthGlobal1X128

SetFeeGrowthGlobal1X128 stores the token1 fee-growth accumulator.

Parameters

Name
Type
Description

feeGrowthGlobal1X128

*u256.Uint

token1 fee growth per liquidity unit, scaled by 2^128.

source

SetLiquidity

SetLiquidity stores the pool's active liquidity for the current tick range.

Parameters

Name
Type
Description

liquidity

*u256.Uint

active liquidity amount to store.

source

SetPosition

SetPosition stores position information under an encoded range key.

Parameters

Name
Type
Description

posKey

string

encoded lower/upper tick-range key.

positionInfo

PositionInfo

aggregate position state to store.

source

SetPositions

SetPositions replaces the tree containing aggregate position state.

Parameters

Name
Type
Description

positions

*bptree.BPTree

position storage tree to use.

source

SetProtocolFees

SetProtocolFees replaces the pool's accrued protocol fees for both tokens.

Parameters

Name
Type
Description

protocolFees

TokenPair

token0 and token1 protocol-fee balances to store.

source

SetProtocolFeesToken0

SetProtocolFeesToken0 updates the pool's accrued token0 protocol fees.

Parameters

Name
Type
Description

token0

int64

new token0 protocol-fee balance.

source

SetProtocolFeesToken1

SetProtocolFeesToken1 updates the pool's accrued token1 protocol fees.

Parameters

Name
Type
Description

token1

int64

new token1 protocol-fee balance.

source

SetSlot0

SetSlot0 replaces the pool's current price, tick, lock, and oracle cursor state.

Parameters

Name
Type
Description

slot0

Slot0

slot0 state to store.

source

SetTick

SetTick stores tick state under its encoded tick key.

Parameters

Name
Type
Description

tick

int32

tick index to store.

tickInfo

TickInfo

tick state associated with the index.

source

SetTickBitmap

SetTickBitmap stores one initialized-tick bitmap word.

Parameters

Name
Type
Description

wordPos

int16

signed bitmap word position.

tickBitmap

string

encoded bitmap bits for that word.

source

SetTickBitmaps

SetTickBitmaps replaces the map of initialized-tick bitmap words.

Parameters

Name
Type
Description

tickBitmaps

map[int16]string

bitmap words keyed by signed word position.

source

SetTickSpacing

SetTickSpacing stores the permitted spacing between initialized ticks.

Parameters

Name
Type
Description

tickSpacing

int32

tick spacing to configure for the pool.

source

SetTicks

SetTicks replaces the tree containing pool tick state.

Parameters

Name
Type
Description

ticks

*bptree.BPTree

tick storage tree to use.

source

SetToken0Path

Pool Setters methods SetToken0Path stores the path of the pool's token0 asset.

Parameters

Name
Type
Description

token0Path

string

token0 asset path to store.

source

SetToken1Path

SetToken1Path stores the path of the pool's token1 asset.

Parameters

Name
Type
Description

token1Path

string

token1 asset path to store.

source

Slot0

Slot0 returns the pool's current price, tick, lock, and oracle cursor state.

Return Values

Name
Type
Description

Slot0

Slot0

current slot0 state, including the price and observation metadata.

source

Slot0FeeProtocol

Slot0FeeProtocol returns the packed protocol-fee denominators from slot0.

Return Values

Name
Type
Description

uint8

uint8

packed token0/token1 protocol-fee denominator configuration.

source

Slot0SqrtPriceX96

Slot0SqrtPriceX96 returns the current square-root price in Q96 fixed-point form.

Return Values

Name
Type
Description

*u256.Uint

*u256.Uint

stored sqrt(token1/token0) price scaled by 2^96.

source

Slot0Tick

Slot0Tick returns the current pool tick.

Return Values

Name
Type
Description

int32

int32

tick corresponding to the current pool price.

source

Slot0Unlocked

Slot0Unlocked reports whether the pool is currently available for reentrant operations.

Return Values

Name
Type
Description

bool

bool

true when the pool is unlocked; false while its swap lock is held.

source

TickBitmaps

TickBitmaps returns the map of initialized-tick bitmap words.

Return Values

Name
Type
Description

map[int16]string

map[int16]string

bitmap words keyed by signed word position.

source

TickSpacing

TickSpacing returns the permitted spacing between initialized ticks.

Return Values

Name
Type
Description

int32

int32

tick spacing configured for the pool.

source

Ticks

Ticks returns the tree containing tick state keyed by encoded tick.

Return Values

Name
Type
Description

*bptree.BPTree

*bptree.BPTree

pool tick storage tree.

source

Token0Path

Token0Path returns the path of the pool's token0 asset.

Return Values

Name
Type
Description

string

string

token0 path stored in the pool.

source

Token1Path

Token1Path returns the path of the pool's token1 asset.

Return Values

Name
Type
Description

string

string

token1 path stored in the pool.

source

Constructors

  • func NewPool(token0Path string, token1Path string, fee uint32, sqrtPriceX96 *u256.Uint, tickSpacing int32, tick int32, slot0FeeProtocol uint8) *Pool (source)

PositionInfo

PositionInfo stores aggregate liquidity, fee-growth checkpoints, and tokens owed for one pool-scoped lower/upper tick key.

source

Methods

FeeGrowthInside0LastX128

FeeGrowthInside0LastX128 returns the token0 fee-growth checkpoint for this position.

Return Values

Name
Type
Description

string

string

token0 inside fee-growth checkpoint scaled by 2^128.

source

FeeGrowthInside1LastX128

FeeGrowthInside1LastX128 returns the token1 fee-growth checkpoint for this position.

Return Values

Name
Type
Description

string

string

token1 inside fee-growth checkpoint scaled by 2^128.

source

Liquidity

Liquidity returns aggregate liquidity for this position range.

Return Values

Name
Type
Description

string

string

position liquidity encoded as a decimal string.

source

SetFeeGrowthInside0LastX128

SetFeeGrowthInside0LastX128 updates the token0 fee-growth checkpoint.

Parameters

Name
Type
Description

feeGrowthInside0LastX128

string

token0 inside fee-growth checkpoint scaled by 2^128, encoded as a decimal string.

source

SetFeeGrowthInside1LastX128

SetFeeGrowthInside1LastX128 updates the token1 fee-growth checkpoint.

Parameters

Name
Type
Description

feeGrowthInside1LastX128

string

token1 inside fee-growth checkpoint scaled by 2^128, encoded as a decimal string.

source

SetLiquidity

SetLiquidity updates aggregate liquidity for this position range.

Parameters

Name
Type
Description

liquidity

string

position liquidity encoded as a decimal string.

source

SetTokensOwed0

SetTokensOwed0 updates token0 accumulated for this position.

Parameters

Name
Type
Description

tokensOwed0

int64

token0 principal or fee amount awaiting collection.

source

SetTokensOwed1

SetTokensOwed1 updates token1 accumulated for this position.

Parameters

Name
Type
Description

tokensOwed1

int64

token1 principal or fee amount awaiting collection.

source

TokensOwed0

TokensOwed0 returns token0 accumulated for this position.

Return Values

Name
Type
Description

int64

int64

token0 principal or fee amount awaiting collection.

source

TokensOwed1

TokensOwed1 returns token1 accumulated for this position.

Return Values

Name
Type
Description

int64

int64

token1 principal or fee amount awaiting collection.

source

Constructors

  • func NewDefaultPositionInfo() PositionInfo (source)

  • func NewPositionInfo() PositionInfo (source)

Slot0

Slot0 mirrors Uniswap V3's slot0(): current price/tick/protocol-fee/lock state and the oracle cursor/capacity metadata.

source

Methods

Clone

Clone returns a value-type copy of Slot0 that shares no mutable state with the original, so callers cannot reach back into pool internals through the returned sqrtPriceX96 pointer.

Return Values

Name
Type
Description

Slot0

Slot0

value copy with a cloned sqrt-price pointer.

source

FeeProtocol

FeeProtocol returns the packed protocol-fee denominators in slot0.

Return Values

Name
Type
Description

uint8

uint8

packed token0/token1 protocol-fee denominator configuration.

source

ObservationCardinality

ObservationCardinality returns the number of observation slots currently available.

Return Values

Name
Type
Description

uint16

uint16

current observation capacity.

source

ObservationCardinalityNext

ObservationCardinalityNext returns the requested future observation capacity.

Return Values

Name
Type
Description

uint16

uint16

next observation capacity to use when the ring grows.

source

ObservationIndex

ObservationIndex returns the index of the most recently written observation.

Return Values

Name
Type
Description

uint16

uint16

current observation ring-buffer index.

source

SetFeeProtocol

SetFeeProtocol updates the packed slot0 protocol-fee denominators.

Parameters

Name
Type
Description

feeProtocol

uint8

packed token0/token1 protocol-fee denominator configuration.

source

SetObservationCardinality

SetObservationCardinality updates the current observation capacity.

Parameters

Name
Type
Description

observationCardinality

uint16

current number of observation slots available.

source

SetObservationCardinalityNext

SetObservationCardinalityNext updates the requested future observation capacity.

Parameters

Name
Type
Description

observationCardinalityNext

uint16

next capacity to use when the ring grows.

source

SetObservationIndex

SetObservationIndex updates the index of the most recently written observation.

Parameters

Name
Type
Description

observationIndex

uint16

observation ring-buffer index to store.

source

SetSqrtPriceX96

SetSqrtPriceX96 updates the slot0 sqrt price.

Parameters

Name
Type
Description

sqrtPriceX96

*u256.Uint

sqrt(token1/token0) price scaled by 2^96; it is cloned before storage.

source

SetTick

SetTick updates the current slot0 tick.

Parameters

Name
Type
Description

tick

int32

current pool tick to store.

source

SetUnlocked

SetUnlocked updates the slot0 reentrancy-lock state.

Parameters

Name
Type
Description

unlocked

bool

true to mark the pool unlocked, false to mark it locked.

source

SqrtPriceX96

SqrtPriceX96 returns a copy of the current sqrt price in Q96 fixed-point form.

Return Values

Name
Type
Description

*u256.Uint

*u256.Uint

cloned sqrt(token1/token0) price scaled by 2^96.

source

Tick

Tick returns the current pool tick recorded in slot0.

Return Values

Name
Type
Description

int32

int32

current tick.

source

Unlocked

Unlocked reports whether the pool's reentrancy lock is open.

Return Values

Name
Type
Description

bool

bool

true when unlocked and false while the pool is locked.

source

Constructors

  • func GetSlot0(poolPath string) Slot0 (source)

  • func NewSlot0(sqrtPriceX96 *u256.Uint, tick int32, feeProtocol uint8, unlocked bool) Slot0 (source)

TickInfo

TickInfo stores information about a specific tick in the pool. TIcks represent discrete price points that can be used as boundaries for positions.

source

Methods

Clone

Clone returns an independent value copy of this tick's stored state.

Return Values

Name
Type
Description

TickInfo

TickInfo

copied liquidity, fee-growth, time, and initialization fields.

source

FeeGrowthOutside0X128

FeeGrowthOutside0X128 returns token0 fee growth on the side of this tick opposite the current tick.

Return Values

Name
Type
Description

string

string

token0 outside fee-growth accumulator scaled by 2^128.

source

FeeGrowthOutside1X128

FeeGrowthOutside1X128 returns token1 fee growth on the side of this tick opposite the current tick.

Return Values

Name
Type
Description

string

string

token1 outside fee-growth accumulator scaled by 2^128.

source

Initialized

Initialized reports whether this tick has active initialized state.

Return Values

Name
Type
Description

bool

bool

true when the tick is initialized; false otherwise.

source

LiquidityGross

TickInfo Getters methods LiquidityGross returns total position liquidity referencing this tick.

Return Values

Name
Type
Description

string

string

gross liquidity encoded as a decimal string.

source

LiquidityNet

LiquidityNet returns net liquidity applied when this tick is crossed.

Return Values

Name
Type
Description

string

string

signed net liquidity encoded as a decimal string.

source

SecondsOutside

SecondsOutside returns the time spent on the side of this tick opposite the current tick.

Return Values

Name
Type
Description

uint32

uint32

seconds accumulated outside the tick.

source

SecondsPerLiquidityOutsideX128

SecondsPerLiquidityOutsideX128 returns seconds per liquidity outside this tick.

Return Values

Name
Type
Description

string

string

outside seconds-per-liquidity accumulator scaled by 2^128.

source

SetFeeGrowthOutside0X128

SetFeeGrowthOutside0X128 stores token0 outside fee growth for this tick.

Parameters

Name
Type
Description

feeGrowthOutside0X128

string

token0 outside fee growth scaled by 2^128, encoded as a decimal string.

source

SetFeeGrowthOutside1X128

SetFeeGrowthOutside1X128 stores token1 outside fee growth for this tick.

Parameters

Name
Type
Description

feeGrowthOutside1X128

string

token1 outside fee growth scaled by 2^128, encoded as a decimal string.

source

SetInitialized

SetInitialized updates whether this tick is initialized.

Parameters

Name
Type
Description

initialized

bool

true to mark the tick initialized, false otherwise.

source

SetLiquidityGross

TickInfo Setters methods SetLiquidityGross stores total position liquidity referencing this tick.

Parameters

Name
Type
Description

liquidityGross

string

gross liquidity encoded as a decimal string.

source

SetLiquidityNet

SetLiquidityNet stores the net liquidity change applied when crossing this tick.

Parameters

Name
Type
Description

liquidityNet

string

signed net liquidity encoded as a decimal string.

source

SetSecondsOutside

SetSecondsOutside stores the seconds accumulated outside this tick.

Parameters

Name
Type
Description

secondsOutside

uint32

elapsed seconds outside the tick.

source

SetSecondsPerLiquidityOutsideX128

SetSecondsPerLiquidityOutsideX128 stores outside seconds-per-liquidity growth.

Parameters

Name
Type
Description

secondsPerLiquidityOutsideX128

string

outside seconds per liquidity scaled by 2^128, encoded as a decimal string.

source

SetTickCumulativeOutside

SetTickCumulativeOutside stores cumulative tick value outside this tick.

Parameters

Name
Type
Description

tickCumulativeOutside

int64

cumulative tick value on the opposite side.

source

TickCumulativeOutside

TickCumulativeOutside returns cumulative tick value on the side opposite the current tick.

Return Values

Name
Type
Description

int64

int64

outside cumulative tick value.

source

Constructors

  • func GetTickInfo(poolPath string, tick int32) (TickInfo, error) (source)

  • func NewTickInfo() TickInfo (source)

TokenPair

source

Methods

SetToken0

SetToken0 updates the token0 amount in the pair.

Parameters

Name
Type
Description

token0

int64

token0 amount to store.

source

SetToken1

SetToken1 updates the token1 amount in the pair.

Parameters

Name
Type
Description

token1

int64

token1 amount to store.

source

Token0

Token0 returns the token0 amount in the pair.

Return Values

Name
Type
Description

int64

int64

stored token0 amount.

source

Token1

Token1 returns the token1 amount in the pair.

Return Values

Name
Type
Description

int64

int64

stored token1 amount.

source

Constructors

  • func NewTokenPair() TokenPair (source)

Last updated