Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

pool state

Back to all declarations

GetPoolCount

func() int

GetPoolCount returns the total number of pools.

Open
OID
07abb6…7fed:3
GetPoolCount details

Inspect func

GetPoolPaths

func(offset int, count int) []string

GetPoolPaths returns a paginated list of pool paths.

Open
OID
07abb6…7fed:5
GetPoolPaths details

Inspect func

ExistsPoolPath

func(poolPath string) bool

ExistsPoolPath checks if a pool exists at the given path.

Open
OID
07abb6…7fed:6
ExistsPoolPath details

Inspect func

GetBalances

func(poolPath string) (int64, int64)

GetBalances returns the balances of the pool.

Open
OID
07abb6…7fed:7
GetBalances details

Inspect func

GetBalanceToken0

func(poolPath string) int64

GetBalanceToken0 returns the balance of token0 in the pool.

Open
OID
07abb6…7fed:8
GetBalanceToken0 details

Inspect func

GetBalanceToken1

func(poolPath string) int64

GetBalanceToken1 returns the balance of token1 in the pool.

Open
OID
07abb6…7fed:9
GetBalanceToken1 details

Inspect func

GetFee

func(poolPath string) uint32

GetFee returns the fee tier of the pool.

Open
OID
07abb6…7fed:10
GetFee details

Inspect func

GetFeeAmountTickSpacings

func() map[uint32]int32

GetFeeAmountTickSpacings returns all fee tier to tick spacing mappings.

Open
OID
07abb6…7fed:11
GetFeeAmountTickSpacings details

Inspect func

GetFeeAmountTickSpacing

func(fee uint32) spacing int32

GetFeeAmountTickSpacing retrieves the mapping between fee amounts and tick spacing. This mapping determines the tick spacing for each supported fee tier.

Open
OID
07abb6…7fed:12
GetFeeAmountTickSpacing details

Inspect func

GetFeeGrowthGlobal0X128

func(poolPath string) string

GetFeeGrowthGlobal0X128 returns the global fee growth for token0.

Open
OID
07abb6…7fed:13
GetFeeGrowthGlobal0X128 details

Inspect func

GetFeeGrowthGlobal1X128

func(poolPath string) string

GetFeeGrowthGlobal1X128 returns the global fee growth for token1.

Open
OID
07abb6…7fed:14
GetFeeGrowthGlobal1X128 details

Inspect func

GetFeeGrowthGlobalX128

func(poolPath string) (string, string)

GetFeeGrowthGlobalX128 returns the global fee growth for both tokens.

Open
OID
07abb6…7fed:15
GetFeeGrowthGlobalX128 details

Inspect func

GetLiquidity

func(poolPath string) string

GetLiquidity returns the current liquidity in the pool.

Open
OID
07abb6…7fed:16
GetLiquidity details

Inspect func

GetObservation

func(poolPath string, secondsAgo int64) (tickCumulative int64, liquidityCumulative string, secondsPerLiquidityCumulativeX128 string, blockTimestamp int64)

GetObservation returns observation data for calculating time-weighted averages.

Open
OID
07abb6…7fed:17
GetObservation details

Inspect func

GetPoolCreationFee

func() int64

GetPoolCreationFee retrieves the pool creation fee amount.

Open
OID
07abb6…7fed:18
GetPoolCreationFee details

Inspect func

GetPositionFeeGrowthInside0LastX128

func(poolPath string, key string) string

GetPositionFeeGrowthInside0LastX128 returns the last recorded fee growth inside for token0.

Open
OID
07abb6…7fed:19
GetPositionFeeGrowthInside0LastX128 details

Inspect func

GetPositionFeeGrowthInside1LastX128

func(poolPath string, key string) string

GetPositionFeeGrowthInside1LastX128 returns the last recorded fee growth inside for token1.

Open
OID
07abb6…7fed:20
GetPositionFeeGrowthInside1LastX128 details

Inspect func

GetPositionFeeGrowthInsideLastX128

func(poolPath string, key string) (string, string)

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

Open
OID
07abb6…7fed:21
GetPositionFeeGrowthInsideLastX128 details

Inspect func

GetPoolPositionCount

func(poolPath string) int

GetPoolPositionCount returns the number of positions in a pool.

Open
OID
07abb6…7fed:22
GetPoolPositionCount details

Inspect func

GetPoolPositionKeys

func(poolPath string, offset int, count int) []string

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

Open
OID
07abb6…7fed:23
GetPoolPositionKeys details

Inspect func

GetPositionLiquidity

func(poolPath string, key string) string

GetPositionLiquidity returns the liquidity of a position.

Open
OID
07abb6…7fed:24
GetPositionLiquidity details

Inspect func

GetPositionTokensOwed0

func(poolPath string, key string) int64

GetPositionTokensOwed0 returns the amount of token0 owed to a position.

Open
OID
07abb6…7fed:25
GetPositionTokensOwed0 details

Inspect func

GetPositionTokensOwed1

func(poolPath string, key string) int64

GetPositionTokensOwed1 returns the amount of token1 owed to a position.

Open
OID
07abb6…7fed:26
GetPositionTokensOwed1 details

Inspect func

GetPositionTokensOwed

func(poolPath string, key string) (int64, int64)

GetPositionTokensOwedInfos returns the amount of tokens owed for both tokens.

Open
OID
07abb6…7fed:27
GetPositionTokensOwed details

Inspect func

GetProtocolFeesToken0

func(poolPath string) int64

GetProtocolFeesToken0 returns accumulated protocol fees for token0.

Open
OID
07abb6…7fed:28
GetProtocolFeesToken0 details

Inspect func

GetProtocolFeesToken1

func(poolPath string) int64

GetProtocolFeesToken1 returns accumulated protocol fees for token1.

Open
OID
07abb6…7fed:29
GetProtocolFeesToken1 details

Inspect func

GetProtocolFeesTokens

func(poolPath string) (int64, int64)

GetProtocolFeesTokens returns the accumulated protocol fees for both tokens.

Open
OID
07abb6…7fed:30
GetProtocolFeesTokens details

Inspect func

GetSlot0FeeProtocol

func(poolPath string) uint8

GetSlot0FeeProtocol retrieves the protocol fee percentage for slot0.

Open
OID
07abb6…7fed:31
GetSlot0FeeProtocol details

Inspect func

GetSlot0SqrtPriceX96

func(poolPath string) string

GetSlot0SqrtPriceX96 returns the current sqrt price from slot0.

Open
OID
07abb6…7fed:32
GetSlot0SqrtPriceX96 details

Inspect func

GetSlot0Tick

func(poolPath string) int32

GetSlot0Tick returns the current tick from slot0.

Open
OID
07abb6…7fed:33
GetSlot0Tick details

Inspect func

GetSlot0Unlocked

func(poolPath string) bool

GetSlot0Unlocked returns the locked status from slot0.

Open
OID
07abb6…7fed:34
GetSlot0Unlocked details

Inspect func

GetTickCumulativeOutside

func(poolPath string, tick int32) int64

GetTickCumulativeOutside returns the tick cumulative value outside a tick.

Open
OID
07abb6…7fed:35
GetTickCumulativeOutside details

Inspect func

GetTickFeeGrowthOutside0X128

func(poolPath string, tick int32) string

GetTickFeeGrowthOutside0X128 returns fee growth outside for token0 at a tick.

Open
OID
07abb6…7fed:36
GetTickFeeGrowthOutside0X128 details

Inspect func

GetTickFeeGrowthOutside1X128

func(poolPath string, tick int32) string

GetTickFeeGrowthOutside1X128 returns fee growth outside for token1 at a tick.

Open
OID
07abb6…7fed:37
GetTickFeeGrowthOutside1X128 details

Inspect func

GetTickFeeGrowthOutsideX128

func(poolPath string, tick int32) (string, string)

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

Open
OID
07abb6…7fed:38
GetTickFeeGrowthOutsideX128 details

Inspect func

GetTickInitialized

func(poolPath string, tick int32) bool

GetTickInitialized returns whether a tick is initialized.

Open
OID
07abb6…7fed:39
GetTickInitialized details

Inspect func

GetInitializedTicksInRange

func(poolPath string, tickLower int32, tickUpper int32) []int32

GetInitializedTicksInRange returns initialized ticks within the given range.

Open
OID
07abb6…7fed:40
GetInitializedTicksInRange details

Inspect func

GetTickLiquidityGross

func(poolPath string, tick int32) string

GetTickLiquidityGross returns the total liquidity that references a tick.

Open
OID
07abb6…7fed:41
GetTickLiquidityGross details

Inspect func

GetTickLiquidityNet

func(poolPath string, tick int32) string

GetTickLiquidityNet returns the net liquidity change at a tick.

Open
OID
07abb6…7fed:42
GetTickLiquidityNet details

Inspect func

GetTickSecondsOutside

func(poolPath string, tick int32) uint32

GetTickSecondsOutside returns seconds spent outside a tick.

Open
OID
07abb6…7fed:43
GetTickSecondsOutside details

Inspect func

GetTickSecondsPerLiquidityOutsideX128

func(poolPath string, tick int32) string

GetTickSecondsPerLiquidityOutsideX128 returns seconds per liquidity outside a tick.

Open
OID
07abb6…7fed:44
GetTickSecondsPerLiquidityOutsideX128 details

Inspect func

GetTickSpacing

func(poolPath string) int32

GetTickSpacing returns the tick spacing of the pool.

Open
OID
07abb6…7fed:45
GetTickSpacing details

Inspect func

GetToken0Path

func(poolPath string) string

GetToken0Path returns the path of token0 in the pool.

Open
OID
07abb6…7fed:46
GetToken0Path details

Inspect func

GetToken1Path

func(poolPath string) string

GetToken1Path returns the path of token1 in the pool.

Open
OID
07abb6…7fed:47
GetToken1Path details

Inspect func

GetWithdrawalFee

func() uint64

GetWithdrawalFee returns the current withdrawal fee rate.

Open
OID
07abb6…7fed:48
GetWithdrawalFee details

Inspect func

GetTWAP

func(poolPath string, secondsAgo uint32) (int32, string, .uverse.error)

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

Open
OID
07abb6…7fed:49
GetTWAP details

Inspect func

GetPool

func(token0Path string, token1Path string, fee uint32) (*pool.Pool, .uverse.error)

GetPool returns a copy of the pool for the given token pair and fee tier.

Open
OID
07abb6…7fed:50
GetPool details

Inspect func

GetTickInfo

func(poolPath string, tick int32) (pool.TickInfo, .uverse.error)

GetTickInfo returns the tick info for a given tick.

Open
OID
07abb6…7fed:51
GetTickInfo details

Inspect func

GetTickBitmaps

func(poolPath string, wordPos int16) (string, .uverse.error)

GetTickBitmaps returns the tick bitmap for a given word position.

Open
OID
07abb6…7fed:52
GetTickBitmaps details

Inspect func

GetPosition

func(poolPath string, key string) (pool.PositionInfo, .uverse.error)

GetPosition returns the position info for a given key.

Open
OID
07abb6…7fed:53
GetPosition details

Inspect func

GetObservationState

func(poolPath string) (*pool.ObservationState, .uverse.error)

GetObservationState returns the observation state for a given pool path.

Open
OID
07abb6…7fed:54
GetObservationState details

Inspect func

cloneStringSlice

func(src []string) []string
Open
OID
07abb6…7fed:55
cloneStringSlice details

Inspect func

cloneInt32Slice

func(src []int32) []int32
Open
OID
07abb6…7fed:57
cloneInt32Slice details

Inspect func

cloneFeeAmountTickSpacings

func(src map[uint32]int32) map[uint32]int32
Open
OID
07abb6…7fed:58
cloneFeeAmountTickSpacings details

Inspect func

clonePositionInfo

func(src pool.PositionInfo) pool.PositionInfo
Open
OID
07abb6…7fed:59
clonePositionInfo details

Inspect func

cloneObservationState

func(src *pool.ObservationState) *pool.ObservationState
Open
OID
07abb6…7fed:60
cloneObservationState details

Inspect func

clonePool

func(src *pool.Pool) *pool.Pool
Open
OID
07abb6…7fed:61
clonePool details

Inspect func

clonePoolTicks

func(src *v0.BPTree) *v0.BPTree
Open
OID
07abb6…7fed:62
clonePoolTicks details

Inspect func

clonePoolTickBitmaps

func(src map[int16]string) map[int16]string
Open
OID
07abb6…7fed:63
clonePoolTickBitmaps details

Inspect func

cloneStringInt64Map

func(src map[string]int64) map[string]int64
Open
OID
07abb6…7fed:64
cloneStringInt64Map details

Inspect func

NewDefaultPositionInfo

func() pool.PositionInfo
Open
OID
07abb6…7fed:65
NewDefaultPositionInfo details

Inspect func

ObservationState

type

ObservationState manages the oracle's historical data

Value

pool.ObservationState

Observation

type

Value

pool.Observation

NewObservationState

func(currentTime int64) *pool.ObservationState
Open
OID
07abb6…7fed:66
NewObservationState details

Inspect func

NewObservation

func(blockTimestamp int64, tickCumulative int64, liquidityCumulative string, secondsPerLiquidityCumulativeX128 string, initialized bool) *pool.Observation
Open
OID
07abb6…7fed:68
NewObservation details

Inspect func

NewDefaultObservation

func() *pool.Observation
Open
OID
07abb6…7fed:69
NewDefaultObservation details

Inspect func

Pool

type

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

Value

pool.Pool

NewPool

func(token0Path string, token1Path string, fee uint32, sqrtPriceX96 *uint256.Uint, tickSpacing int32, tick int32, slot0FeeProtocol uint8) *pool.Pool
Open
OID
07abb6…7fed:70
NewPool details

Inspect func

NewPoolsTree

func() *v0.BPTree
Open
OID
07abb6…7fed:72
NewPoolsTree details

Inspect func

NewPoolTicksTree

func() *v0.BPTree

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.

Open
OID
07abb6…7fed:73
NewPoolTicksTree details

Inspect func

NewPoolPositionsTree

func() *v0.BPTree

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.

Open
OID
07abb6…7fed:74
NewPoolPositionsTree details

Inspect func

TokenPair

type

Value

pool.TokenPair

NewTokenPair

func() pool.TokenPair
Open
OID
07abb6…7fed:75
NewTokenPair details

Inspect func

Slot0

type

Value

pool.Slot0

NewSlot0

func(sqrtPriceX96 *uint256.Uint, tick int32, feeProtocol uint8, unlocked bool) pool.Slot0
Open
OID
07abb6…7fed:76
NewSlot0 details

Inspect func

TickInfo

type

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

Value

pool.TickInfo

NewTickInfo

func() pool.TickInfo
Open
OID
07abb6…7fed:77
NewTickInfo details

Inspect func

PositionInfo

type

PositionInfo stores liquidity and fee state for a position. Liquidity and fee-growth fields are stored as decimal strings to reduce storage cost, while transferable owed amounts stay as int64 for token transfer boundaries.

Value

pool.PositionInfo

NewPositionInfo

func() pool.PositionInfo
Open
OID
07abb6…7fed:78
NewPositionInfo details

Inspect func

NewDefaultFeeAmountTickSpacing

func() map[uint32]int32
Open
OID
07abb6…7fed:79
NewDefaultFeeAmountTickSpacing details

Inspect func

CreatePool

func(token0Path string, token1Path string, fee uint32, sqrtPriceX96 string)

CreatePool creates a new liquidity pool for a token pair. Parameters: - token0Path: path of the first token - token1Path: path of the second token - fee: pool fee tier - sqrtPriceX96: initial sqrt price (Q64.96 format)

Open
OID
07abb6…7fed:80
CreatePool details

Inspect func

SetPoolCreationFee

func(fee int64)

SetPoolCreationFee stores the pool creation fee amount.

Open
OID
07abb6…7fed:82
SetPoolCreationFee details

Inspect func

IncreaseObservationCardinalityNext

func(token0Path string, token1Path string, fee uint32, cardinalityNext uint16)

IncreaseObservationCardinalityNext increases the observation cardinality for a pool. Parameters: - token0Path: path of the first token - token1Path: path of the second token - fee: pool fee tier - cardinalityNext: new observation cardinality limit

Open
OID
07abb6…7fed:83
IncreaseObservationCardinalityNext details

Inspect func

Mint

func(token0Path string, token1Path string, fee uint32, tickLower int32, tickUpper int32, liquidityAmount string, positionCaller .uverse.address) (string, string)

Mint adds liquidity to a position. Parameters: - token0Path: path of the first token - token1Path: path of the second token - fee: pool fee tier - tickLower: lower tick boundary - tickUpper: upper tick boundary - liquidityAmount: amount of liquidity to add - positionCaller: caller address for the position Returns: - string: amount of token0 added - string: amount of token1 added

Open
OID
07abb6…7fed:84
Mint details

Inspect func

Burn

func(token0Path string, token1Path string, fee uint32, tickLower int32, tickUpper int32, liquidityAmount string, positionCaller .uverse.address) (string, string)

Burn removes liquidity from a position.

Open
OID
07abb6…7fed:85
Burn details

Inspect func

Collect

func(token0Path string, token1Path string, fee uint32, recipient .uverse.address, tickLower int32, tickUpper int32, amount0Requested string, amount1Requested string) (string, string)

Collect transfers owed tokens from a position to recipient.

Open
OID
07abb6…7fed:86
Collect details

Inspect func

SetWithdrawalFee

func(fee uint64)

SetWithdrawalFee sets the withdrawal fee rate. Parameters: - fee: withdrawal fee in basis points

Open
OID
07abb6…7fed:87
SetWithdrawalFee details

Inspect func

HandleWithdrawalFee

func(token0Path string, amount0 string, token1Path string, amount1 string, positionCaller .uverse.address) (string, string, string, string)

HandleWithdrawalFee processes withdrawal fees for a position. Parameters: - token0Path: path of the first token - amount0: amount of token0 to withdraw - token1Path: path of the second token - amount1: amount of token1 to withdraw - positionCaller: caller address for the position Returns: - string: withdrawal fee amount of token0 - string: withdrawal fee amount of token1 - string: net amount of token0 after fees - string: net amount of token1 after fees

Open
OID
07abb6…7fed:88
HandleWithdrawalFee details

Inspect func

Swap

func(token0Path string, token1Path string, fee uint32, recipient .uverse.address, zeroForOne bool, amountSpecified string, sqrtPriceLimitX96 string, payer .uverse.address, swapCallback func(...)) (string, string)

Swap executes a token swap in the pool. Parameters: - token0Path: path of the first token - token1Path: path of the second token - fee: pool fee tier - recipient: recipient address for output tokens - zeroForOne: true if swapping token0 for token1 - amountSpecified: amount to swap (positive for exact input, negative for exact output) - sqrtPriceLimitX96: price limit for the swap - payer: address that will pay for the swap - swapCallback: callback function for token transfer, callbackMarker is used to identify the callback Returns: - string: amount of token0 delta - string: amount of token1 delta

Open
OID
07abb6…7fed:89
Swap details

Inspect func

DrySwap

func(token0Path string, token1Path string, fee uint32, zeroForOne bool, amountSpecified string, sqrtPriceLimitX96 string) (string, string, bool)

DrySwap simulates a swap without executing it, returning the expected output. This is a read-only operation that does not modify pool state. Used by router for multi-hop swap simulations and by clients for price quotes. Parameters: - token0Path: path of the first token - token1Path: path of the second token - fee: pool fee tier - zeroForOne: true if swapping token0 for token1 - amountSpecified: amount to swap - sqrtPriceLimitX96: price limit for the swap Returns: - string: amount of token0 delta - string: amount of token1 delta - bool: swap success status

Open
OID
07abb6…7fed:90
DrySwap details

Inspect func

SetSwapEndHook

func(hook func(...))

SetSwapEndHook stores the swap end hook function.

Open
OID
07abb6…7fed:91
SetSwapEndHook details

Inspect func

SetSwapStartHook

func(hook func(...))

SetSwapStartHook stores the swap start hook function.

Open
OID
07abb6…7fed:92
SetSwapStartHook details

Inspect func

SetTickCrossHook

func(hook func(...))

SetTickCrossHook stores the tick cross hook function.

Open
OID
07abb6…7fed:93
SetTickCrossHook details

Inspect func

CollectProtocol

func(token0Path string, token1Path string, fee uint32, recipient .uverse.address, amount0Requested string, amount1Requested string) (string, string)

CollectProtocol collects protocol fees from a pool. Parameters: - token0Path: path of the first token - token1Path: path of the second token - fee: pool fee tier - recipient: recipient address for fees - amount0Requested: amount of token0 to collect - amount1Requested: amount of token1 to collect Returns: - string: amount of token0 collected - string: amount of token1 collected

Open
OID
07abb6…7fed:94
CollectProtocol details

Inspect func

SetFeeProtocol

func(feeProtocol0 uint8, feeProtocol1 uint8)

SetFeeProtocol sets the protocol fee rates for a pool. Parameters: - feeProtocol0: protocol fee rate for token0 - feeProtocol1: protocol fee rate for token1

Open
OID
07abb6…7fed:95
SetFeeProtocol details

Inspect func

ErrSpoofedRealm

untyped string

Value

"rlm does not match the current crossing frame"

domainPath

string

Value

"gno.land/r/gnoswap/pool"

currentAddress

.uverse.address

Value

<gnolang.StringValue>

versionManager

*version_manager.versionManager
Open
OID
07abb6…7fed:124
versionManager details

Inspect pointer

initializeDomainStore

func(int, rlm .uverse.realm, kvStore store.KVStore) interface{...}
Open
OID
07abb6…7fed:103
initializeDomainStore details

Inspect func

getImplementation

func() pool.IPool

getImplementation returns the currently active pool implementation. This function is used by all proxy functions to route calls to the active implementation. If no implementation is set, it panics to prevent invalid state.

Open
OID
07abb6…7fed:104
getImplementation details

Inspect func

updateImplementation

func() .uverse.error
Open
OID
07abb6…7fed:105
updateImplementation details

Inspect func

StoreKey

type

StoreKey defines the keys used for storing pool data in the KV store. These keys are prefixed with the domain address to ensure namespace isolation.

Value

pool.StoreKey

StoreKeyPools

pool.StoreKey

// Map containing all pools

Value

<gnolang.StringValue>

StoreKeyFeeAmountTickSpacing

pool.StoreKey

// Fee tier to tick spacing mapping

Value

<gnolang.StringValue>

StoreKeySlot0FeeProtocol

pool.StoreKey

// Protocol fee percentage

Value

<gnolang.StringValue>

StoreKeyPoolCreationFee

pool.StoreKey

// Pool creation fee amount

Value

<gnolang.StringValue>

StoreKeyPendingProtocolFees

pool.StoreKey

// tokenPath -> amount held locally for protocol\_fee

Value

<gnolang.StringValue>

StoreKeyWithdrawalFeeBPS

pool.StoreKey

// Withdrawal fee in basis points

Value

<gnolang.StringValue>

StoreKeyUnlocked

pool.StoreKey

// Global pool reentrancy lock

Value

<gnolang.StringValue>

StoreKeySwapStartHook

pool.StoreKey

// Swap start hook function

Value

<gnolang.StringValue>

StoreKeySwapEndHook

pool.StoreKey

// Swap end hook function

Value

<gnolang.StringValue>

StoreKeyTickCrossHook

pool.StoreKey

// Tick cross hook function

Value

<gnolang.StringValue>

poolStore

type

poolStore implements the IPoolStore interface for pool domain storage. It provides type-safe access to pool data stored in the underlying KV store.

Value

pool.poolStore

NewPoolStore

func(kvStore store.KVStore) pool.IPoolStore

NewPoolStore creates a new pool store instance with the provided KV store. This function is used by the upgrade system to create storage instances for each implementation.

Open
OID
07abb6…7fed:106
NewPoolStore details

Inspect func

IPool

type

IPool interface defines all public methods that must be implemented by pool contract versions. This interface serves as the contract between the proxy layer and implementation versions, ensuring that all versions (v1, v2, v3, etc.) maintain the same public API. This design enables seamless upgrades while maintaining backwards compatibility. When upgrading from v1 to v2, the proxy simply switches the implementation pointer without changing the public interface, ensuring zero downtime and no breaking changes.

Value

pool.IPool

IPoolManager

type

IPoolManager interface defines pool management operations. These methods handle pool creation and fee configuration.

Value

pool.IPoolManager

IPoolPosition

type

IPoolPosition interface defines position management operations. These methods handle liquidity provision and position management.

Value

pool.IPoolPosition

IPoolSwap

type

IPoolSwap interface defines swap and protocol fee operations. These methods handle token swaps and protocol fee management.

Value

pool.IPoolSwap

IPoolGetter

type

IPoolGetter interface defines data retrieval operations. These methods provide read-only access to pool state and data.

Value

pool.IPoolGetter

IPoolStore

type

IPoolStore interface defines the storage abstraction for pool data. This interface provides a clean separation between business logic and storage, allowing different implementations to use the same storage interface. All pool implementations (v1, v2, etc.) use this interface to access and modify pool state, ensuring data consistency across versions.

Value

pool.IPoolStore

CallbackMarker

type

Value

pool.CallbackMarker

NewCallbackMarker

func() *pool.CallbackMarker

NewCallbackMarker allocates a CallbackMarker in the pool realm. Construction must happen here because /r/-declared types can only be allocated in their owning realm (interrealm v2 checkConstructionTime). Callers in other realms (e.g. pool/v1 impl) borrow into pool via borrow rule #1 (function defined in /r/ package).

Open
OID
07abb6…7fed:108
NewCallbackMarker details

Inspect func

RegisterInitializer

func(initializer func(...))

RegisterInitializer registers a new pool implementation version. This function is called by each version (v1, v2, etc.) during initialization to register their implementation with the proxy system. The initializer function creates a new instance of the implementation using the provided poolStore interface. The stateInitializer function creates the initial state for this version. Security: Only contracts within the domain path can register initializers. Each package path can only register once to prevent duplicate registrations.

Open
OID
07abb6…7fed:110
RegisterInitializer details

Inspect func

UpgradeImpl

func(packagePath string)

UpgradeImpl switches the active pool implementation to a different version. This function allows seamless upgrades from one version to another without data migration or downtime. Security: Only admin or governance can perform upgrades. The new implementation must have been previously registered via RegisterInitializer.

Open
OID
07abb6…7fed:112
UpgradeImpl details

Inspect func

GetImplementationPackagePath

func() string

GetImplementationPackagePath returns the package path of the currently active implementation.

Open
OID
07abb6…7fed:113
GetImplementationPackagePath details

Inspect func

MAX_TICK

int32

Value

887272

ENCODED_TICK_OFFSET

int32

Value

887272

GetPoolPath

func(token0Path string, token1Path string, fee uint32) string

GetPoolPath generates a unique pool path string based on the token paths and fee tier.

Open
OID
07abb6…7fed:114
GetPoolPath details

Inspect func

EncodeTickKey

func(tick int32) string

EncodeTickKey encodes a tick to a string key for the tick tree.

Open
OID
07abb6…7fed:116
EncodeTickKey details

Inspect func

EncodePositionKey

func(tickLower int32, tickUpper int32) string

EncodePositionKey encodes a position range into a fixed-width 20-byte string.

Open
OID
07abb6…7fed:117
EncodePositionKey details

Inspect func

encodeTickKeyToBuffer

func(dst []uint8, tick int32)
Open
OID
07abb6…7fed:118
encodeTickKeyToBuffer details

Inspect func

DecodeTickKey

func(s string) int32

DecodeTickKey decodes a string key to a tick.

Open
OID
07abb6…7fed:119
DecodeTickKey details

Inspect func
GetPoolCount : func() int Inspect
GetPoolPaths : func(offset int, count int) []string Inspect
ExistsPoolPath : func(poolPath string) bool Inspect
GetBalances : func(poolPath string) (int64, int64) Inspect
GetBalanceToken0 : func(poolPath string) int64 Inspect
GetBalanceToken1 : func(poolPath string) int64 Inspect
GetFee : func(poolPath string) uint32 Inspect
GetFeeAmountTickSpacings : func() map[uint32]int32 Inspect
GetFeeAmountTickSpacing : func(fee uint32) spacing int32 Inspect
GetFeeGrowthGlobal0X128 : func(poolPath string) string Inspect
GetFeeGrowthGlobal1X128 : func(poolPath string) string Inspect
GetFeeGrowthGlobalX128 : func(poolPath string) (string, string) Inspect
GetLiquidity : func(poolPath string) string Inspect
GetObservation : func(poolPath string, secondsAgo int64) (tickCumulative int64, liquidityCumulative string, secondsPerLiquidityCumulativeX128 string, blockTimestamp int64) Inspect
GetPoolCreationFee : func() int64 Inspect
GetPositionFeeGrowthInside0LastX128 : func(poolPath string, key string) string Inspect
GetPositionFeeGrowthInside1LastX128 : func(poolPath string, key string) string Inspect
GetPositionFeeGrowthInsideLastX128 : func(poolPath string, key string) (string, string) Inspect
GetPoolPositionCount : func(poolPath string) int Inspect
GetPoolPositionKeys : func(poolPath string, offset int, count int) []string Inspect
GetPositionLiquidity : func(poolPath string, key string) string Inspect
GetPositionTokensOwed0 : func(poolPath string, key string) int64 Inspect
GetPositionTokensOwed1 : func(poolPath string, key string) int64 Inspect
GetPositionTokensOwed : func(poolPath string, key string) (int64, int64) Inspect
GetProtocolFeesToken0 : func(poolPath string) int64 Inspect
GetProtocolFeesToken1 : func(poolPath string) int64 Inspect
GetProtocolFeesTokens : func(poolPath string) (int64, int64) Inspect
GetSlot0FeeProtocol : func(poolPath string) uint8 Inspect
GetSlot0SqrtPriceX96 : func(poolPath string) string Inspect
GetSlot0Tick : func(poolPath string) int32 Inspect
GetSlot0Unlocked : func(poolPath string) bool Inspect
GetTickCumulativeOutside : func(poolPath string, tick int32) int64 Inspect
GetTickFeeGrowthOutside0X128 : func(poolPath string, tick int32) string Inspect
GetTickFeeGrowthOutside1X128 : func(poolPath string, tick int32) string Inspect
GetTickFeeGrowthOutsideX128 : func(poolPath string, tick int32) (string, string) Inspect
GetTickInitialized : func(poolPath string, tick int32) bool Inspect
GetInitializedTicksInRange : func(poolPath string, tickLower int32, tickUpper int32) []int32 Inspect
GetTickLiquidityGross : func(poolPath string, tick int32) string Inspect
GetTickLiquidityNet : func(poolPath string, tick int32) string Inspect
GetTickSecondsOutside : func(poolPath string, tick int32) uint32 Inspect
GetTickSecondsPerLiquidityOutsideX128 : func(poolPath string, tick int32) string Inspect
GetTickSpacing : func(poolPath string) int32 Inspect
GetToken0Path : func(poolPath string) string Inspect
GetToken1Path : func(poolPath string) string Inspect
GetWithdrawalFee : func() uint64 Inspect
GetTWAP : func(poolPath string, secondsAgo uint32) (int32, string, .uverse.error) Inspect
GetPool : func(token0Path string, token1Path string, fee uint32) (*pool.Pool, .uverse.error) Inspect
GetTickInfo : func(poolPath string, tick int32) (pool.TickInfo, .uverse.error) Inspect
GetTickBitmaps : func(poolPath string, wordPos int16) (string, .uverse.error) Inspect
GetPosition : func(poolPath string, key string) (pool.PositionInfo, .uverse.error) Inspect
GetObservationState : func(poolPath string) (*pool.ObservationState, .uverse.error) Inspect
cloneStringSlice : func(src []string) []string Inspect
cloneInt32Slice : func(src []int32) []int32 Inspect
cloneFeeAmountTickSpacings : func(src map[uint32]int32) map[uint32]int32 Inspect
clonePositionInfo : func(src pool.PositionInfo) pool.PositionInfo Inspect
cloneObservationState : func(src *pool.ObservationState) *pool.ObservationState Inspect
clonePool : func(src *pool.Pool) *pool.Pool Inspect
clonePoolTicks : func(src *v0.BPTree) *v0.BPTree Inspect
clonePoolTickBitmaps : func(src map[int16]string) map[int16]string Inspect
cloneStringInt64Map : func(src map[string]int64) map[string]int64 Inspect
NewDefaultPositionInfo : func() pool.PositionInfo Inspect
ObservationState : type =pool.ObservationState
Observation : type =pool.Observation
NewObservationState : func(currentTime int64) *pool.ObservationState Inspect
NewObservation : func(blockTimestamp int64, tickCumulative int64, liquidityCumulative string, secondsPerLiquidityCumulativeX128 string, initialized bool) *pool.Observation Inspect
NewDefaultObservation : func() *pool.Observation Inspect
Pool : type =pool.Pool
NewPool : func(token0Path string, token1Path string, fee uint32, sqrtPriceX96 *uint256.Uint, tickSpacing int32, tick int32, slot0FeeProtocol uint8) *pool.Pool Inspect
NewPoolsTree : func() *v0.BPTree Inspect
NewPoolTicksTree : func() *v0.BPTree Inspect
NewPoolPositionsTree : func() *v0.BPTree Inspect
TokenPair : type =pool.TokenPair
NewTokenPair : func() pool.TokenPair Inspect
Slot0 : type =pool.Slot0
NewSlot0 : func(sqrtPriceX96 *uint256.Uint, tick int32, feeProtocol uint8, unlocked bool) pool.Slot0 Inspect
TickInfo : type =pool.TickInfo
NewTickInfo : func() pool.TickInfo Inspect
PositionInfo : type =pool.PositionInfo
NewPositionInfo : func() pool.PositionInfo Inspect
NewDefaultFeeAmountTickSpacing : func() map[uint32]int32 Inspect
CreatePool : func(token0Path string, token1Path string, fee uint32, sqrtPriceX96 string) Inspect
SetPoolCreationFee : func(fee int64) Inspect
IncreaseObservationCardinalityNext : func(token0Path string, token1Path string, fee uint32, cardinalityNext uint16) Inspect
Mint : func(token0Path string, token1Path string, fee uint32, tickLower int32, tickUpper int32, liquidityAmount string, positionCaller .uverse.address) (string, string) Inspect
Burn : func(token0Path string, token1Path string, fee uint32, tickLower int32, tickUpper int32, liquidityAmount string, positionCaller .uverse.address) (string, string) Inspect
Collect : func(token0Path string, token1Path string, fee uint32, recipient .uverse.address, tickLower int32, tickUpper int32, amount0Requested string, amount1Requested string) (string, string) Inspect
SetWithdrawalFee : func(fee uint64) Inspect
HandleWithdrawalFee : func(token0Path string, amount0 string, token1Path string, amount1 string, positionCaller .uverse.address) (string, string, string, string) Inspect
Swap : func(token0Path string, token1Path string, fee uint32, recipient .uverse.address, zeroForOne bool, amountSpecified string, sqrtPriceLimitX96 string, payer .uverse.address, swapCallback func(...)) (string, string) Inspect
DrySwap : func(token0Path string, token1Path string, fee uint32, zeroForOne bool, amountSpecified string, sqrtPriceLimitX96 string) (string, string, bool) Inspect
SetSwapEndHook : func(hook func(...)) Inspect
SetSwapStartHook : func(hook func(...)) Inspect
SetTickCrossHook : func(hook func(...)) Inspect
CollectProtocol : func(token0Path string, token1Path string, fee uint32, recipient .uverse.address, amount0Requested string, amount1Requested string) (string, string) Inspect
SetFeeProtocol : func(feeProtocol0 uint8, feeProtocol1 uint8) Inspect
ErrSpoofedRealm : untyped string ="rlm does not match the current crossing frame"
domainPath : string ="gno.land/r/gnoswap/pool"
currentAddress : .uverse.address =<gnolang.StringValue>
kvStore : *store.kvStore Inspect
versionManager : *version_manager.versionManager Inspect
implementation : *v1.poolV1 Inspect
init.101 : func() Inspect
initializeDomainStore : func(int, rlm .uverse.realm, kvStore store.KVStore) interface{...} Inspect
getImplementation : func() pool.IPool Inspect
updateImplementation : func() .uverse.error Inspect
StoreKey : type =pool.StoreKey
StoreKeyPools : pool.StoreKey =<gnolang.StringValue>
StoreKeyFeeAmountTickSpacing : pool.StoreKey =<gnolang.StringValue>
StoreKeySlot0FeeProtocol : pool.StoreKey =<gnolang.StringValue>
StoreKeyPoolCreationFee : pool.StoreKey =<gnolang.StringValue>
StoreKeyPendingProtocolFees : pool.StoreKey =<gnolang.StringValue>
StoreKeyWithdrawalFeeBPS : pool.StoreKey =<gnolang.StringValue>
StoreKeyUnlocked : pool.StoreKey =<gnolang.StringValue>
StoreKeySwapStartHook : pool.StoreKey =<gnolang.StringValue>
StoreKeySwapEndHook : pool.StoreKey =<gnolang.StringValue>
StoreKeyTickCrossHook : pool.StoreKey =<gnolang.StringValue>
poolStore : type =pool.poolStore
NewPoolStore : func(kvStore store.KVStore) pool.IPoolStore Inspect
IPool : type =pool.IPool
IPoolManager : type =pool.IPoolManager
IPoolPosition : type =pool.IPoolPosition
IPoolSwap : type =pool.IPoolSwap
IPoolGetter : type =pool.IPoolGetter
IPoolStore : type =pool.IPoolStore
CallbackMarker : type =pool.CallbackMarker
NewCallbackMarker : func() *pool.CallbackMarker Inspect
RegisterInitializer : func(initializer func(...)) Inspect
UpgradeImpl : func(packagePath string) Inspect
GetImplementationPackagePath : func() string Inspect
MAX_TICK : int32 =887272
ENCODED_TICK_OFFSET : int32 =887272
GetPoolPath : func(token0Path string, token1Path string, fee uint32) string Inspect
EncodeTickKey : func(tick int32) string Inspect
EncodePositionKey : func(tickLower int32, tickUpper int32) string Inspect
encodeTickKeyToBuffer : func(dst []uint8, tick int32) Inspect
DecodeTickKey : func(s string) int32 Inspect