getter.gno

GetPoolCount

func GetPoolCount() int

GetPoolCount returns the total number of pools.

Return Values

Name
Type
Description

count

int

total number of pools

GetPoolPaths

GetPoolPaths returns a paginated list of pool paths.

Parameters

Name
Type
Description

offset

int

starting index for pagination

count

int

maximum number of pool paths to return

Return Values

Name
Type
Description

poolPaths

[]string

pool paths for the requested page

ExistsPoolPath

ExistsPoolPath checks if a pool exists at the given path.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

exists

bool

true if the pool exists

GetBalances

GetBalances returns the balances of the pool.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

balance0

string

balance of token0

balance1

string

balance of token1

GetBalanceToken0

GetBalanceToken0 returns the balance of token0 in the pool.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

balance0

string

balance of token0

GetBalanceToken1

GetBalanceToken1 returns the balance of token1 in the pool.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

balance1

string

balance of token1

GetFee

GetFee returns the fee tier of the pool.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

fee

uint32

pool fee tier

GetFeeAmountTickSpacing

GetFeeAmountTickSpacing returns the tick spacing for a given fee tier.

Parameters

Name
Type
Description

fee

uint32

pool fee tier

Return Values

Name
Type
Description

spacing

int32

tick spacing for the fee tier

GetFeeAmountTickSpacings

GetFeeAmountTickSpacings returns all fee tier to tick spacing mappings.

Return Values

Name
Type
Description

feeAmountTickSpacings

map[uint32]int32

mapping of fee tier to tick spacing

GetFeeGrowthGlobal0X128

GetFeeGrowthGlobal0X128 returns the global fee growth for token0.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

feeGrowthGlobal0X128

string

fee growth for token0 as Q128.128

GetFeeGrowthGlobal1X128

GetFeeGrowthGlobal1X128 returns the global fee growth for token1.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

feeGrowthGlobal1X128

string

fee growth for token1 as Q128.128

GetFeeGrowthGlobalX128

GetFeeGrowthGlobalX128 returns the global fee growth for both tokens.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

feeGrowthGlobal0X128

*u256.Uint

fee growth for token0 as Q128.128

feeGrowthGlobal1X128

*u256.Uint

fee growth for token1 as Q128.128

GetFeeGrowthGlobals

GetFeeGrowthGlobals returns the global fee growth for both tokens.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

feeGrowthGlobal0X128

string

fee growth for token0 as Q128.128

feeGrowthGlobal1X128

string

fee growth for token1 as Q128.128

GetLiquidity

GetLiquidity returns the current liquidity in the pool.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

liquidity

string

current liquidity as a decimal string

GetMaxLiquidityPerTick

GetMaxLiquidityPerTick returns the maximum liquidity per tick for the pool.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

maxLiquidityPerTick

string

max liquidity per tick as a decimal string

GetObservation

GetObservation returns observation data for calculating time-weighted averages.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

secondsAgo

int64

time window to look back from current block timestamp

Return Values

Name
Type
Description

tickCumulative

int64

tick cumulative

liquidityCumulative

string

liquidity cumulative

secondsPerLiquidityCumulativeX128

string

seconds per liquidity cumulative (Q128.128)

blockTimestamp

int64

block timestamp of the observation

GetPoolCreationFee

GetPoolCreationFee returns the current pool creation fee.

Return Values

Name
Type
Description

poolCreationFee

int64

pool creation fee

GetInitializedTicksInRange

GetInitializedTicksInRange returns initialized ticks within the given range.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

tickLower

int32

lower tick boundary

tickUpper

int32

upper tick boundary

Return Values

Name
Type
Description

ticks

[]int32

initialized tick indices within the range

GetPoolPositionCount

GetPoolPositionCount returns the number of positions in a pool.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

count

int

number of positions in the pool


GetPoolPositionKeys

GetPoolPositionKeys returns a paginated list of position keys in a pool.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

offset

int

starting index for pagination

count

int

maximum number of keys to return

Return Values

Name
Type
Description

keys

[]string

position keys for the requested page


GetPositionFeeGrowthInside0LastX128

GetPositionFeeGrowthInside0LastX128 returns the last recorded fee growth inside for token0.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

key

string

position key

Return Values

Name
Type
Description

feeGrowthInside0LastX128

string

fee growth for token0 inside the position


GetPositionFeeGrowthInside1LastX128

GetPositionFeeGrowthInside1LastX128 returns the last recorded fee growth inside for token1.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

key

string

position key

Return Values

Name
Type
Description

feeGrowthInside1LastX128

string

fee growth for token1 inside the position


GetPositionFeeGrowthInsideLastX128

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

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

key

string

position key

Return Values

Name
Type
Description

feeGrowthInside0LastX128

*u256.Uint

fee growth for token0 inside the position

feeGrowthInside1LastX128

*u256.Uint

fee growth for token1 inside the position


GetPositionFeeGrowthInsideLasts

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

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

key

string

position key

Return Values

Name
Type
Description

feeGrowthInside0LastX128

string

fee growth for token0 inside the position

feeGrowthInside1LastX128

string

fee growth for token1 inside the position


GetPositionLiquidity

GetPositionLiquidity returns the liquidity of a position.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

key

string

position key

Return Values

Name
Type
Description

liquidity

*u256.Uint

position liquidity


GetPositionTokensOwed

GetPositionTokensOwed returns the amount of tokens owed for both tokens.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

key

string

position key

Return Values

Name
Type
Description

tokensOwed0

string

amount of token0 owed to the position

tokensOwed1

string

amount of token1 owed to the position


GetPositionTokensOwed0

GetPositionTokensOwed0 returns the amount of token0 owed to a position.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

key

string

position key

Return Values

Name
Type
Description

tokensOwed0

string

amount of token0 owed to the position


GetPositionTokensOwed1

GetPositionTokensOwed1 returns the amount of token1 owed to a position.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

key

string

position key

Return Values

Name
Type
Description

tokensOwed1

string

amount of token1 owed to the position


GetProtocolFeesToken0

GetProtocolFeesToken0 returns accumulated protocol fees for token0.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

protocolFeesToken0

string

accumulated protocol fees for token0


GetProtocolFeesToken1

GetProtocolFeesToken1 returns accumulated protocol fees for token1.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

protocolFeesToken1

string

accumulated protocol fees for token1


GetProtocolFeesTokens

GetProtocolFeesTokens returns the accumulated protocol fees for both tokens.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

protocolFeesToken0

string

accumulated protocol fees for token0

protocolFeesToken1

string

accumulated protocol fees for token1


GetSlot0FeeProtocol

GetSlot0FeeProtocol returns the protocol fee rate from slot0.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

feeProtocol

uint8

protocol fee rate packed in slot0


GetSlot0SqrtPriceX96

GetSlot0SqrtPriceX96 returns the current sqrt price from slot0.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

sqrtPriceX96

*u256.Uint

sqrt price in Q64.96 format


GetSlot0Tick

GetSlot0Tick returns the current tick from slot0.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

tick

int32

current tick


GetSlot0Unlocked

GetSlot0Unlocked returns the locked status from slot0.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

unlocked

bool

true if pool is unlocked


GetTWAP

GetTWAP returns the time-weighted average price for a pool. Returns arithmetic mean tick and harmonic mean liquidity over the time period.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

secondsAgo

uint32

lookback window in seconds

Return Values

Name
Type
Description

meanTick

int32

arithmetic mean tick

meanLiquidity

*u256.Uint

harmonic mean liquidity

err

error

non-nil on failure


GetTickBitmaps

GetTickBitmaps returns the tick bitmap for a given word position.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

wordPos

int16

bitmap word position

Return Values

Name
Type
Description

tickBitmap

*u256.Uint

tick bitmap copy

err

error

non-nil if the bitmap cannot be loaded


GetTickCumulativeOutside

GetTickCumulativeOutside returns the tick cumulative value outside a tick.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

tick

int32

tick index

Return Values

Name
Type
Description

tickCumulativeOutside

int64

tick cumulative outside the tick


GetTickFeeGrowthOutside0X128

GetTickFeeGrowthOutside0X128 returns fee growth outside for token0 at a tick.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

tick

int32

tick index

Return Values

Name
Type
Description

feeGrowthOutside0X128

string

fee growth outside for token0 as Q128.128


GetTickFeeGrowthOutside1X128

GetTickFeeGrowthOutside1X128 returns fee growth outside for token1 at a tick.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

tick

int32

tick index

Return Values

Name
Type
Description

feeGrowthOutside1X128

string

fee growth outside for token1 as Q128.128


GetTickFeeGrowthOutsideX128

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

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

tick

int32

tick index

Return Values

Name
Type
Description

feeGrowthOutside0X128

*u256.Uint

fee growth outside for token0 as Q128.128

feeGrowthOutside1X128

*u256.Uint

fee growth outside for token1 as Q128.128


GetTickFeeGrowthOutsides

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

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

tick

int32

tick index

Return Values

Name
Type
Description

feeGrowthOutside0X128

string

fee growth outside for token0 as Q128.128

feeGrowthOutside1X128

string

fee growth outside for token1 as Q128.128


GetTickInitialized

GetTickInitialized returns whether a tick is initialized.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

tick

int32

tick index

Return Values

Name
Type
Description

initialized

bool

true if the tick is initialized


GetTickLiquidityGross

GetTickLiquidityGross returns the total liquidity that references a tick.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

tick

int32

tick index

Return Values

Name
Type
Description

liquidityGross

string

gross liquidity for the tick


GetTickLiquidityNet

GetTickLiquidityNet returns the net liquidity change at a tick.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

tick

int32

tick index

Return Values

Name
Type
Description

liquidityNet

string

net liquidity change at the tick


GetTickSecondsOutside

GetTickSecondsOutside returns seconds spent outside a tick.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

tick

int32

tick index

Return Values

Name
Type
Description

secondsOutside

uint32

seconds spent outside the tick


GetTickSecondsPerLiquidityOutsideX128

GetTickSecondsPerLiquidityOutsideX128 returns seconds per liquidity outside a tick.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

tick

int32

tick index

Return Values

Name
Type
Description

secondsPerLiquidityOutsideX128

string

seconds per liquidity outside the tick as Q128.128


GetTickSpacing

GetTickSpacing returns the tick spacing of the pool.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

tickSpacing

int32

tick spacing


GetToken0Path

GetToken0Path returns the path of token0 in the pool.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

token0Path

string

token0 path


GetToken1Path

GetToken1Path returns the path of token1 in the pool.

Parameters

Name
Type
Description

poolPath

string

pool identifier in token0:token1:fee form

Return Values

Name
Type
Description

token1Path

string

token1 path


GetWithdrawalFee

GetWithdrawalFee returns the current withdrawal fee rate.

Return Values

Name
Type
Description

withdrawalFee

uint64

withdrawal fee in basis points

Last updated