getter.gno
GetPoolCount
func GetPoolCount() intGetPoolCount returns the total number of pools.
Return Values
count
int
total number of pools
GetPoolPaths
GetPoolPaths returns a paginated list of pool paths.
Parameters
offset
int
starting index for pagination
count
int
maximum number of pool paths to return
Return Values
poolPaths
[]string
pool paths for the requested page
ExistsPoolPath
ExistsPoolPath checks if a pool exists at the given path.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
exists
bool
true if the pool exists
GetBalances
GetBalances returns the balances of the pool.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
balance0
string
balance of token0
balance1
string
balance of token1
GetBalanceToken0
GetBalanceToken0 returns the balance of token0 in the pool.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
balance0
string
balance of token0
GetBalanceToken1
GetBalanceToken1 returns the balance of token1 in the pool.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
balance1
string
balance of token1
GetFee
GetFee returns the fee tier of the pool.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
fee
uint32
pool fee tier
GetFeeAmountTickSpacing
GetFeeAmountTickSpacing returns the tick spacing for a given fee tier.
Parameters
fee
uint32
pool fee tier
Return Values
spacing
int32
tick spacing for the fee tier
GetFeeAmountTickSpacings
GetFeeAmountTickSpacings returns all fee tier to tick spacing mappings.
Return Values
feeAmountTickSpacings
map[uint32]int32
mapping of fee tier to tick spacing
GetFeeGrowthGlobal0X128
GetFeeGrowthGlobal0X128 returns the global fee growth for token0.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
feeGrowthGlobal0X128
string
fee growth for token0 as Q128.128
GetFeeGrowthGlobal1X128
GetFeeGrowthGlobal1X128 returns the global fee growth for token1.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
feeGrowthGlobal1X128
string
fee growth for token1 as Q128.128
GetFeeGrowthGlobalX128
GetFeeGrowthGlobalX128 returns the global fee growth for both tokens.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
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
poolPath
string
pool identifier in token0:token1:fee form
Return Values
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
poolPath
string
pool identifier in token0:token1:fee form
Return Values
liquidity
string
current liquidity as a decimal string
GetMaxLiquidityPerTick
GetMaxLiquidityPerTick returns the maximum liquidity per tick for the pool.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
maxLiquidityPerTick
string
max liquidity per tick as a decimal string
GetObservation
GetObservation returns observation data for calculating time-weighted averages.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
secondsAgo
int64
time window to look back from current block timestamp
Return Values
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
poolCreationFee
int64
pool creation fee
GetInitializedTicksInRange
GetInitializedTicksInRange returns initialized ticks within the given range.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
tickLower
int32
lower tick boundary
tickUpper
int32
upper tick boundary
Return Values
ticks
[]int32
initialized tick indices within the range
GetPoolPositionCount
GetPoolPositionCount returns the number of positions in a pool.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
count
int
number of positions in the pool
GetPoolPositionKeys
GetPoolPositionKeys returns a paginated list of position keys in a pool.
Parameters
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
keys
[]string
position keys for the requested page
GetPositionFeeGrowthInside0LastX128
GetPositionFeeGrowthInside0LastX128 returns the last recorded fee growth inside for token0.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
key
string
position key
Return Values
feeGrowthInside0LastX128
string
fee growth for token0 inside the position
GetPositionFeeGrowthInside1LastX128
GetPositionFeeGrowthInside1LastX128 returns the last recorded fee growth inside for token1.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
key
string
position key
Return Values
feeGrowthInside1LastX128
string
fee growth for token1 inside the position
GetPositionFeeGrowthInsideLastX128
GetPositionFeeGrowthInsideLastX128 returns the last recorded fee growth inside for both tokens.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
key
string
position key
Return Values
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
poolPath
string
pool identifier in token0:token1:fee form
key
string
position key
Return Values
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
poolPath
string
pool identifier in token0:token1:fee form
key
string
position key
Return Values
liquidity
*u256.Uint
position liquidity
GetPositionTokensOwed
GetPositionTokensOwed returns the amount of tokens owed for both tokens.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
key
string
position key
Return Values
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
poolPath
string
pool identifier in token0:token1:fee form
key
string
position key
Return Values
tokensOwed0
string
amount of token0 owed to the position
GetPositionTokensOwed1
GetPositionTokensOwed1 returns the amount of token1 owed to a position.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
key
string
position key
Return Values
tokensOwed1
string
amount of token1 owed to the position
GetProtocolFeesToken0
GetProtocolFeesToken0 returns accumulated protocol fees for token0.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
protocolFeesToken0
string
accumulated protocol fees for token0
GetProtocolFeesToken1
GetProtocolFeesToken1 returns accumulated protocol fees for token1.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
protocolFeesToken1
string
accumulated protocol fees for token1
GetProtocolFeesTokens
GetProtocolFeesTokens returns the accumulated protocol fees for both tokens.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
protocolFeesToken0
string
accumulated protocol fees for token0
protocolFeesToken1
string
accumulated protocol fees for token1
GetSlot0FeeProtocol
GetSlot0FeeProtocol returns the protocol fee rate from slot0.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
feeProtocol
uint8
protocol fee rate packed in slot0
GetSlot0SqrtPriceX96
GetSlot0SqrtPriceX96 returns the current sqrt price from slot0.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
sqrtPriceX96
*u256.Uint
sqrt price in Q64.96 format
GetSlot0Tick
GetSlot0Tick returns the current tick from slot0.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
tick
int32
current tick
GetSlot0Unlocked
GetSlot0Unlocked returns the locked status from slot0.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
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
poolPath
string
pool identifier in token0:token1:fee form
secondsAgo
uint32
lookback window in seconds
Return Values
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
poolPath
string
pool identifier in token0:token1:fee form
wordPos
int16
bitmap word position
Return Values
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
poolPath
string
pool identifier in token0:token1:fee form
tick
int32
tick index
Return Values
tickCumulativeOutside
int64
tick cumulative outside the tick
GetTickFeeGrowthOutside0X128
GetTickFeeGrowthOutside0X128 returns fee growth outside for token0 at a tick.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
tick
int32
tick index
Return Values
feeGrowthOutside0X128
string
fee growth outside for token0 as Q128.128
GetTickFeeGrowthOutside1X128
GetTickFeeGrowthOutside1X128 returns fee growth outside for token1 at a tick.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
tick
int32
tick index
Return Values
feeGrowthOutside1X128
string
fee growth outside for token1 as Q128.128
GetTickFeeGrowthOutsideX128
GetTickFeeGrowthOutsideX128 returns fee growth outside for both tokens at a tick.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
tick
int32
tick index
Return Values
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
poolPath
string
pool identifier in token0:token1:fee form
tick
int32
tick index
Return Values
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
poolPath
string
pool identifier in token0:token1:fee form
tick
int32
tick index
Return Values
initialized
bool
true if the tick is initialized
GetTickLiquidityGross
GetTickLiquidityGross returns the total liquidity that references a tick.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
tick
int32
tick index
Return Values
liquidityGross
string
gross liquidity for the tick
GetTickLiquidityNet
GetTickLiquidityNet returns the net liquidity change at a tick.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
tick
int32
tick index
Return Values
liquidityNet
string
net liquidity change at the tick
GetTickSecondsOutside
GetTickSecondsOutside returns seconds spent outside a tick.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
tick
int32
tick index
Return Values
secondsOutside
uint32
seconds spent outside the tick
GetTickSecondsPerLiquidityOutsideX128
GetTickSecondsPerLiquidityOutsideX128 returns seconds per liquidity outside a tick.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
tick
int32
tick index
Return Values
secondsPerLiquidityOutsideX128
string
seconds per liquidity outside the tick as Q128.128
GetTickSpacing
GetTickSpacing returns the tick spacing of the pool.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
tickSpacing
int32
tick spacing
GetToken0Path
GetToken0Path returns the path of token0 in the pool.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
token0Path
string
token0 path
GetToken1Path
GetToken1Path returns the path of token1 in the pool.
Parameters
poolPath
string
pool identifier in token0:token1:fee form
Return Values
token1Path
string
token1 path
GetWithdrawalFee
GetWithdrawalFee returns the current withdrawal fee rate.
Return Values
withdrawalFee
uint64
withdrawal fee in basis points
Last updated