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

getter.gno

ExistsPoolPath

ExistsPoolPath checks if a pool exists at the given path.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool to check.

Return Values

Name
Type
Description

bool

bool

True when a pool is registered at poolPath; false otherwise.

source

GetBalanceToken0

GetBalanceToken0 returns the balance of token0 in the pool.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool to query.

Return Values

Name
Type
Description

int64

int64

Current token0 balance held by the pool, in token base units.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetBalanceToken1

GetBalanceToken1 returns the balance of token1 in the pool.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool to query.

Return Values

Name
Type
Description

int64

int64

Current token1 balance held by the pool, in token base units.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetBalances

GetBalances returns the balances of the pool.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool whose balances are read.

Return Values

Name
Type
Description

int64

int64

Current token0 balance held by the pool, in token base units.

int64

int64

Current token1 balance held by the pool, in token base units.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetFee

GetFee returns the fee tier of the pool.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool whose fee tier is read.

Return Values

Name
Type
Description

uint32

uint32

Configured fee tier for the pool.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetFeeAmountTickSpacing

GetFeeAmountTickSpacing returns the tick spacing for a given fee tier.

Parameters

Name
Type
Description

fee

uint32

Fee tier whose supported tick spacing is requested.

Return Values

Name
Type
Description

spacing

int32

Tick spacing configured for fee.

err

error

Non-nil when fee is not one of the supported fee tiers.

source

GetFeeAmountTickSpacings

GetFeeAmountTickSpacings returns all fee tier to tick spacing mappings.

Return Values

Name
Type
Description

map[uint32]int32

map[uint32]int32

Copy of the configured fee-tier-to-tick-spacing mapping.

source

GetFeeGrowthGlobal0X128

GetFeeGrowthGlobal0X128 returns the global fee growth for token0.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool to query.

Return Values

Name
Type
Description

string

string

Token0 global fee growth, serialized as a base-10 X128 accumulator.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetFeeGrowthGlobal1X128

GetFeeGrowthGlobal1X128 returns the global fee growth for token1.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool to query.

Return Values

Name
Type
Description

string

string

Token1 global fee growth, serialized as a base-10 X128 accumulator.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetFeeGrowthGlobalX128

GetFeeGrowthGlobalX128 returns the global fee growth for both tokens.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool to query.

Return Values

Name
Type
Description

string

string

Token0 global fee growth, serialized as a base-10 X128 accumulator.

string

string

Token1 global fee growth, serialized as a base-10 X128 accumulator.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetInitializedTicksInRange

GetInitializedTicksInRange returns initialized ticks within the given range.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path whose ticks are enumerated.

tickLower

int32

Lower inclusive tick bound for enumeration.

tickUpper

int32

Upper bound for enumeration; ticks are selected through the pool's range iterator.

Return Values

Name
Type
Description

[]int32

[]int32

Tick indices that are initialized in the requested range.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetLiquidity

GetLiquidity returns the current liquidity in the pool.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool whose liquidity is read.

Return Values

Name
Type
Description

string

string

Current pool liquidity, serialized as a base-10 unsigned integer.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetPendingProtocolFees

GetPendingProtocolFees returns the pending protocol fee amount per token path.

Return Values

Name
Type
Description

map[string]int64

map[string]int64

Copy of pending protocol fees keyed by token contract path, with amounts in token base units.

source

GetPoolCreationFee

GetPoolCreationFee returns the current pool creation fee.

Return Values

Name
Type
Description

int64

int64

Pool creation fee charged when a new pool is created, in configured native-token base units.

source

GetPoolPositions

GetPoolPositions returns a read-only view of a pool's positions, keyed by position key. nil is returned when the pool does not exist.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool whose positions are read.

Return Values

Name
Type
Description

*rotree.ReadOnlyTree

*rotree.ReadOnlyTree

Read-only tree keyed by position key; nil when the pool does not exist.

source

GetPools

GetPools returns a read-only view of every pool, keyed by pool path. Reading an entry yields a clone, so the view cannot mutate realm state.

Return Values

Name
Type
Description

*rotree.ReadOnlyTree

*rotree.ReadOnlyTree

Read-only tree keyed by canonical pool path; each entry is cloned before it is exposed.

source

GetPositionFeeGrowthInside0LastX128

GetPositionFeeGrowthInside0LastX128 returns the last recorded fee growth inside for token0.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool containing the position.

key

string

Position key identifying the position within the pool.

Return Values

Name
Type
Description

string

string

Position's last token0 fee-growth-inside accumulator, serialized as a base-10 X128 value.

error

error

Non-nil when the pool or position key cannot be found.

source

GetPositionFeeGrowthInside1LastX128

GetPositionFeeGrowthInside1LastX128 returns the last recorded fee growth inside for token1.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool containing the position.

key

string

Position key identifying the position within the pool.

Return Values

Name
Type
Description

string

string

Position's last token1 fee-growth-inside accumulator, serialized as a base-10 X128 value.

error

error

Non-nil when the pool or position key cannot be found.

source

GetPositionFeeGrowthInsideLastX128

GetPositionFeeGrowthInsideLastX128 returns the last recorded fee growth inside for both tokens.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool containing the position.

key

string

Position key identifying the position within the pool.

Return Values

Name
Type
Description

string

string

Position's last token0 fee-growth-inside accumulator, serialized as a base-10 X128 value.

string

string

Position's last token1 fee-growth-inside accumulator, serialized as a base-10 X128 value.

error

error

Non-nil when the pool or position key cannot be found.

source

GetPositionLiquidity

GetPositionLiquidity returns the liquidity of a position.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool containing the position.

key

string

Position key identifying the position within the pool.

Return Values

Name
Type
Description

string

string

Position liquidity, serialized as a base-10 unsigned integer.

error

error

Non-nil when the pool or position key cannot be found.

source

GetPositionTokensOwed

GetPositionTokensOwedInfos returns the amount of tokens owed for both tokens.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool containing the position.

key

string

Position key identifying the position within the pool.

Return Values

Name
Type
Description

int64

int64

Amount of token0 owed to the position, in token base units.

int64

int64

Amount of token1 owed to the position, in token base units.

error

error

Non-nil when the pool or position key cannot be found.

source

GetPositionTokensOwed0

GetPositionTokensOwed0 returns the amount of token0 owed to a position.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool containing the position.

key

string

Position key identifying the position within the pool.

Return Values

Name
Type
Description

int64

int64

Amount of token0 owed to the position, in token base units.

error

error

Non-nil when the pool or position key cannot be found.

source

GetPositionTokensOwed1

GetPositionTokensOwed1 returns the amount of token1 owed to a position.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool containing the position.

key

string

Position key identifying the position within the pool.

Return Values

Name
Type
Description

int64

int64

Amount of token1 owed to the position, in token base units.

error

error

Non-nil when the pool or position key cannot be found.

source

GetProtocolFeesToken0

GetProtocolFeesToken0 returns accumulated protocol fees for token0.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool whose fees are read.

Return Values

Name
Type
Description

int64

int64

Accumulated protocol fee for token0, in token base units.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetProtocolFeesToken1

GetProtocolFeesToken1 returns accumulated protocol fees for token1.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool whose fees are read.

Return Values

Name
Type
Description

int64

int64

Accumulated protocol fee for token1, in token base units.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetProtocolFeesTokens

GetProtocolFeesTokens returns the accumulated protocol fees for both tokens.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool whose fees are read.

Return Values

Name
Type
Description

int64

int64

Accumulated protocol fee for token0, in token base units.

int64

int64

Accumulated protocol fee for token1, in token base units.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetSlot0FeeProtocol

GetSlot0FeeProtocol returns the protocol fee rate from slot0.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool to query.

Return Values

Name
Type
Description

uint8

uint8

Packed protocol-fee denominator configuration from slot0; token0 occupies the low nibble and token1 the high nibble.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetSlot0SqrtPriceX96

GetSlot0SqrtPriceX96 returns the current sqrt price from slot0.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool to query.

Return Values

Name
Type
Description

string

string

Current square-root price in Q64.96 fixed-point form, serialized as a base-10 unsigned integer.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetSlot0Tick

GetSlot0Tick returns the current tick from slot0.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool to query.

Return Values

Name
Type
Description

int32

int32

Current active tick index stored in slot0.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetSlot0Unlocked

GetSlot0Unlocked reports whether the pool is currently unlocked.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool to query.

Return Values

Name
Type
Description

bool

bool

True when the pool is not holding its reentrancy lock; false when the pool is currently locked.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetTickBitmaps

GetTickBitmaps returns the tick bitmap for a given word position.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool containing the bitmap.

wordPos

int16

Signed bitmap word position to read.

Return Values

Name
Type
Description

string

string

Bitmap word serialized as a base-10 unsigned integer.

error

error

Non-nil when the pool or bitmap word is not found.

source

GetTickCumulativeOutside

GetTickCumulativeOutside returns the tick cumulative value outside a tick.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool containing the tick.

tick

int32

Tick index whose outside tick cumulative is requested.

Return Values

Name
Type
Description

int64

int64

Tick cumulative recorded outside tick.

error

error

Non-nil when the pool or tick is not found.

source

GetTickFeeGrowthOutside0X128

GetTickFeeGrowthOutside0X128 returns fee growth outside for token0 at a tick.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool containing the tick.

tick

int32

Tick index whose outside fee growth is requested.

Return Values

Name
Type
Description

string

string

Token0 fee growth outside tick, serialized as a base-10 X128 accumulator.

error

error

Non-nil when the pool or tick is not found.

source

GetTickFeeGrowthOutside1X128

GetTickFeeGrowthOutside1X128 returns fee growth outside for token1 at a tick.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool containing the tick.

tick

int32

Tick index whose outside fee growth is requested.

Return Values

Name
Type
Description

string

string

Token1 fee growth outside tick, serialized as a base-10 X128 accumulator.

error

error

Non-nil when the pool or tick is not found.

source

GetTickFeeGrowthOutsideX128

GetTickFeeGrowthOutsideX128 returns fee growth outside for both tokens at a tick.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool containing the tick.

tick

int32

Tick index whose outside fee growth is requested.

Return Values

Name
Type
Description

string

string

Token0 fee growth outside tick, serialized as a base-10 X128 accumulator.

string

string

Token1 fee growth outside tick, serialized as a base-10 X128 accumulator.

error

error

Non-nil when the pool or tick is not found.

source

GetTickInitialized

GetTickInitialized returns whether a tick is initialized.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool containing the tick.

tick

int32

Tick index whose initialization flag is requested.

Return Values

Name
Type
Description

bool

bool

True when the tick has initialized liquidity and outside accumulators.

error

error

Non-nil when the pool or tick is not found.

source

GetTickLiquidityGross

GetTickLiquidityGross returns the total liquidity that references a tick.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool containing the tick.

tick

int32

Tick index whose gross liquidity is requested.

Return Values

Name
Type
Description

string

string

Gross liquidity referencing the tick, serialized as a base-10 unsigned integer.

error

error

Non-nil when the pool or tick is not found.

source

GetTickLiquidityNet

GetTickLiquidityNet returns the net liquidity change at a tick.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool containing the tick.

tick

int32

Tick index whose net liquidity change is requested.

Return Values

Name
Type
Description

string

string

Signed net liquidity change at the tick, serialized as a base-10 integer.

error

error

Non-nil when the pool or tick is not found.

source

GetTickSecondsOutside

GetTickSecondsOutside returns seconds spent outside a tick.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool containing the tick.

tick

int32

Tick index whose outside time is requested.

Return Values

Name
Type
Description

uint32

uint32

Seconds accumulated outside the tick.

error

error

Non-nil when the pool or tick is not found.

source

GetTickSecondsPerLiquidityOutsideX128

GetTickSecondsPerLiquidityOutsideX128 returns seconds per liquidity outside a tick.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool containing the tick.

tick

int32

Tick index whose outside accumulator is requested.

Return Values

Name
Type
Description

string

string

Seconds-per-liquidity outside tick in X128 precision, serialized as a base-10 unsigned integer.

error

error

Non-nil when the pool or tick is not found.

source

GetTickSpacing

GetTickSpacing returns the tick spacing of the pool.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool whose spacing is read.

Return Values

Name
Type
Description

int32

int32

Tick spacing associated with the pool's fee tier.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetToken0Path

GetToken0Path returns the path of token0 in the pool.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool to query.

Return Values

Name
Type
Description

string

string

Canonical token0 contract path stored by the pool.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetToken1Path

GetToken1Path returns the path of token1 in the pool.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path identifying the pool to query.

Return Values

Name
Type
Description

string

string

Canonical token1 contract path stored by the pool.

error

error

Non-nil when poolPath does not identify an existing pool.

source

GetWithdrawalFee

GetWithdrawalFee returns the current withdrawal fee rate.

Return Values

Name
Type
Description

uint64

uint64

Withdrawal fee rate in basis points; zero means no withdrawal fee is charged.

source

Observe

Observe returns the tick and seconds-per-liquidity cumulatives for each requested lookback, matching Uniswap V3's observe(uint32[] secondsAgos).

Parameters

Name
Type
Description

poolPath

string

Canonical pool path whose oracle history is queried.

secondsAgos

[]uint32

Lookback intervals in seconds; one cumulative pair is returned for each value, in the same order.

Return Values

Name
Type
Description

[]int64

[]int64

Tick cumulative values corresponding to each requested lookback.

[]string

[]string

Seconds-per-liquidity cumulative X128 values, serialized as base-10 strings, corresponding to each lookback.

error

error

Non-nil when pool or observation data cannot be read.

source

OracleConsult

OracleConsult returns the arithmetic mean tick and harmonic mean liquidity over a lookback, following Uniswap V3 OracleLibrary's consult convention.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path whose oracle data is queried.

secondsAgo

uint32

Lookback duration in seconds used to compute the time-weighted values.

Return Values

Name
Type
Description

int32

int32

Arithmetic mean tick over the requested lookback.

string

string

Harmonic mean liquidity over the lookback, serialized as a base-10 unsigned integer.

error

error

Non-nil when the pool or required observation history is unavailable.

source

SnapshotCumulativesInside

SnapshotCumulativesInside returns the tick, seconds-per-liquidity, and seconds cumulatives accrued while the pool price was inside [tickLower, tickUpper). Both boundary ticks must be initialized.

Snapshots are only comparable across an interval during which a position in the range existed, matching Uniswap V3's snapshotCumulativesInside.

Parameters

Name
Type
Description

poolPath

string

Canonical pool path whose oracle snapshot is queried.

tickLower

int32

Lower inclusive tick boundary of the position range.

tickUpper

int32

Upper exclusive tick boundary of the position range; both boundary ticks must be initialized.

Return Values

Name
Type
Description

int64

int64

Tick cumulative accrued while the price was inside the range.

string

string

Seconds-per-liquidity-inside X128 accumulator, serialized as a base-10 string.

uint32

uint32

Seconds accrued while the price was inside the range.

error

error

Non-nil when the pool, observations, or initialized boundaries are unavailable.

source

Last updated