PathrockNetwork Gno Explorer
HomeBlocksTransactionsRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/r/gnoswap/pool

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
pool
Namespace
gnoswap
Files
14 (README)(gnomod.toml)
Exported functions
90
Module
gno.land/r/gnoswap/pool
gno
0.9

Files (14)

  • README.mdmarkdown
  • gnomod.tomltoml
  • errors.gnogno
  • getter_utils.gnogno
  • getter.gnogno
  • oracle.gnogno
  • pool.gnogno
  • proxy.gnogno
  • render.gnogno
  • state.gnogno
  • store.gnogno
  • types.gnogno
  • upgrade.gnogno
  • utils.gnogno
  • state.gnogno
    1package pool23import (4	"errors"56	"gno.land/p/gnoswap/store/v1"7	"gno.land/p/gnoswap/version_manager/v1"89	// initialize rbac roles10	_ "gno.land/r/gnoswap/rbac/v1"11)1213var (14	domainPath string1516	currentAddress address1718	// kvStore is the core storage instance for the pool domain.19	// All pool implementations share this single storage instance,20	// ensuring data consistency across version upgrades.21	kvStore store.KVStore2223	// versionManager is the version manager for the pool domain.24	// It manages the registration and switching of pool implementations.25	versionManager version_manager.VersionManager2627	// implementation is the currently active pool implementation.28	// This pointer is switched during upgrades to point to different versions (v1, v2, etc.).29	// The proxy layer routes all calls to this implementation.30	implementation IPool31)3233// init initializes the pool domain state.34// This function is called when the pool domain contract is first deployed.35func init(cur realm) {36	domainPath = cur.PkgPath()37	currentAddress = cur.Address()3839	// Create a new KV store instance for this domain40	kvStore = store.NewKVStore(currentAddress)4142	// Initialize the initializers map to store implementation registration functions43	versionManager = version_manager.NewVersionManager(44		domainPath,45		kvStore,46		initializeDomainStore,47	)4849	implementation = nil50}5152func initializeDomainStore(_ int, rlm realm, kvStore store.KVStore) any {53	return NewPoolStore(kvStore)54}5556// getImplementation returns the currently active pool implementation.57// This function is used by all proxy functions to route calls to the active implementation.58// If no implementation is set, it panics to prevent invalid state.59func getImplementation() IPool {60	if implementation == nil {61		panic("implementation is not initialized")62	}6364	return implementation65}6667func updateImplementation() error {68	result := versionManager.GetCurrentImplementation()69	if result == nil {70		return errors.New("implementation is not initialized")71	}7273	impl, ok := result.(IPool)74	if !ok {75		return errors.New("impl is not an IPool")76	}7778	implementation = impl7980	return nil81}82

    Functions

    • Burn(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, token0Path string, token1Path string, fee uint32, tickLower int32, tickUpper int32, liquidityAmount string, positionCaller string) (string, string)

    • Collect(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, token0Path string, token1Path string, fee uint32, recipient string, tickLower int32, tickUpper int32, amount0Requested string, amount1Requested string) (string, string)

    • CollectProtocol(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, token0Path string, token1Path string, fee uint32, recipient string, amount0Requested string, amount1Requested string) (string, string)

    • CollectSwapFee(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, token0Path string, token1Path string, fee uint32, recipient string, tickLower int32, tickUpper int32, amount0Requested string, amount1Requested string) (amount0 string, amount1 string, fee0 string, fee1 string)

    • CreatePool(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, token0Path string, token1Path string, fee uint32, sqrtPriceX96 string)

    • DecodeTickKey(key string) int32

    • DefaultObservation() struct{blockTimestamp int64; tickCumulative int64; secondsPerLiquidityCumulativeX128 string; initialized bool}

    • DrySwap(token0Path string, token1Path string, fee uint32, zeroForOne bool, amountSpecified string, sqrtPriceLimitX96 string) (string, string, interface {Error func() string})

    • EncodePositionKey(tickLower int32, tickUpper int32) string

    • EncodeTickKey(tick int32) string

    • ExistsPoolPath(poolPath string) bool

    • GetBalances(poolPath string) (int64, int64, interface {Error func() string})

    • GetBalanceToken0(poolPath string) (int64, interface {Error func() string})

    • GetBalanceToken1(poolPath string) (int64, interface {Error func() string})

    • GetFee(poolPath string) (uint32, interface {Error func() string})

    • GetFeeAmountTickSpacing(fee uint32) (spacing int32, err interface {Error func() string})

    • GetFeeAmountTickSpacings() map[uint32]int32

    • GetFeeGrowthGlobal0X128(poolPath string) (string, interface {Error func() string})

    • GetFeeGrowthGlobal1X128(poolPath string) (string, interface {Error func() string})

    • GetFeeGrowthGlobalX128(poolPath string) (string, string, interface {Error func() string})

    • GetImplementationPackagePath() string

    • GetInitializedTicksInRange(poolPath string, tickLower int32, tickUpper int32) ([]int32, interface {Error func() string})

    • GetLiquidity(poolPath string) (string, interface {Error func() string})

    • GetObservationAt(poolPath string, index uint16) (struct{blockTimestamp int64; tickCumulative int64; secondsPerLiquidityCumulativeX128 string; initialized bool}, interface {Error func() string})

    • GetPendingProtocolFees() map[string]int64

    • GetPoolCreationFee() int64

    • GetPoolPath(token0Path string, token1Path string, fee uint32) string

    • GetPoolPositions(poolPath string) *gno.land/p/nt/bptree/rotree/v0.ReadOnlyTree

    • GetPools() *gno.land/p/nt/bptree/rotree/v0.ReadOnlyTree

    • GetPositionFeeGrowthInside0LastX128(poolPath string, key string) (string, interface {Error func() string})

    • GetPositionFeeGrowthInside1LastX128(poolPath string, key string) (string, interface {Error func() string})

    • GetPositionFeeGrowthInsideLastX128(poolPath string, key string) (string, string, interface {Error func() string})

    • GetPositionLiquidity(poolPath string, key string) (string, interface {Error func() string})

    • GetPositionTokensOwed(poolPath string, key string) (int64, int64, interface {Error func() string})

    • GetPositionTokensOwed0(poolPath string, key string) (int64, interface {Error func() string})

    • GetPositionTokensOwed1(poolPath string, key string) (int64, interface {Error func() string})

    • GetProtocolFeesToken0(poolPath string) (int64, interface {Error func() string})

    • GetProtocolFeesToken1(poolPath string) (int64, interface {Error func() string})

    • GetProtocolFeesTokens(poolPath string) (int64, int64, interface {Error func() string})

    • GetSlot0(poolPath string) struct{sqrtPriceX96 *gno.land/p/gnoswap/uint256/v1.Uint; tick int32; feeProtocol uint8; unlocked bool; observationIndex uint16; observationCardinality uint16; observationCardinalityNext uint16}

    • GetSlot0FeeProtocol(poolPath string) (uint8, interface {Error func() string})

    • GetSlot0SqrtPriceX96(poolPath string) (string, interface {Error func() string})

    • GetSlot0Tick(poolPath string) (int32, interface {Error func() string})

    • GetSlot0Unlocked(poolPath string) (bool, interface {Error func() string})

    • GetTickBitmaps(poolPath string, wordPos int16) (string, interface {Error func() string})

    • GetTickCumulativeOutside(poolPath string, tick int32) (int64, interface {Error func() string})

    • GetTickFeeGrowthOutside0X128(poolPath string, tick int32) (string, interface {Error func() string})

    • GetTickFeeGrowthOutside1X128(poolPath string, tick int32) (string, interface {Error func() string})

    • GetTickFeeGrowthOutsideX128(poolPath string, tick int32) (string, string, interface {Error func() string})

    • GetTickInfo(poolPath string, tick int32) (struct{liquidityGross string; liquidityNet string; feeGrowthOutside0X128 string; feeGrowthOutside1X128 string; tickCumulativeOutside int64; secondsPerLiquidityOutsideX128 string; secondsOutside uint32; initialized bool}, interface {Error func() string})

    • GetTickInitialized(poolPath string, tick int32) (bool, interface {Error func() string})

    • GetTickLiquidityGross(poolPath string, tick int32) (string, interface {Error func() string})

    • GetTickLiquidityNet(poolPath string, tick int32) (string, interface {Error func() string})

    • GetTickSecondsOutside(poolPath string, tick int32) (uint32, interface {Error func() string})

    • GetTickSecondsPerLiquidityOutsideX128(poolPath string, tick int32) (string, interface {Error func() string})

    • GetTickSpacing(poolPath string) (int32, interface {Error func() string})

    • GetToken0Path(poolPath string) (string, interface {Error func() string})

    • GetToken1Path(poolPath string) (string, interface {Error func() string})

    • GetWithdrawalFee() uint64

    • IncreaseObservationCardinalityNext(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, token0Path string, token1Path string, fee uint32, cardinalityNext uint16)

    • MakeObservation(blockTimestamp int64, tickCumulative int64, secondsPerLiquidityCumulativeX128 string, initialized bool) struct{blockTimestamp int64; tickCumulative int64; secondsPerLiquidityCumulativeX128 string; initialized bool}

    • Mint(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, token0Path string, token1Path string, fee uint32, tickLower int32, tickUpper int32, liquidityAmount string, positionCaller string) (string, string)

    • NewCallbackMarker() *gno.land/r/gnoswap/pool.CallbackMarker

    • NewDefaultFeeAmountTickSpacing() map[uint32]int32

    • NewDefaultPositionInfo() struct{liquidity string; feeGrowthInside0LastX128 string; feeGrowthInside1LastX128 string; tokensOwed0 int64; tokensOwed1 int64}

    • NewObservationsTree() *gno.land/p/nt/bptree/v0.BPTree

    • NewObservationTree() *gno.land/r/gnoswap/pool.ObservationTree

    • NewPool(token0Path string, token1Path string, fee uint32, sqrtPriceX96 *gno.land/p/gnoswap/uint256/v1.Uint, tickSpacing int32, tick int32, slot0FeeProtocol uint8) *gno.land/r/gnoswap/pool.Pool

    • NewPoolObservationsTree(currentTime int64) *gno.land/r/gnoswap/pool.ObservationTree

    • NewPoolPositionsTree() *gno.land/p/nt/bptree/v0.BPTree

    • NewPoolStore(kvStore interface {AddAuthorizedCaller func(int, .uverse.realm, .uverse.address, gno.land/p/gnoswap/store/v1.Permission) .uverse.error; Delete func(int, .uverse.realm, string) .uverse.error; Get func(string) (interface {}, .uverse.error); GetAddress func(string) (.uverse.address, .uverse.error); GetAllKeys func() ([]string, .uverse.error); GetAuthorizedCallers func() (map[.uverse.address]gno.land/p/gnoswap/store/v1.Permission, .uverse.error); GetBPTree func(string) (*gno.land/p/nt/bptree/v0.BPTree, .uverse.error); GetBool func(string) (bool, .uverse.error); GetDomainAddress func() .uverse.address; GetInt64 func(string) (int64, .uverse.error); GetString func(string) (string, .uverse.error); GetUint64 func(string) (uint64, .uverse.error); Has func(string) bool; IsWriteAuthorized func(.uverse.address) bool; RemoveAuthorizedCaller func(int, .uverse.realm, .uverse.address) .uverse.error; Set func(int, .uverse.realm, string, interface {}) .uverse.error; UpdateAuthorizedCaller func(int, .uverse.realm, .uverse.address, gno.land/p/gnoswap/store/v1.Permission) .uverse.error}) interface {GetFeeAmountTickSpacing func() map[uint32]int32; GetObservations func() *gno.land/p/nt/bptree/v0.BPTree; GetPendingProtocolFee func(string) int64; GetPendingProtocolFees func() map[string]int64; GetPoolCreationFee func() int64; GetPools func() *gno.land/p/nt/bptree/v0.BPTree; GetSlot0FeeProtocol func() uint8; GetSwapEndHook func() func(.uverse.realm, string) .uverse.error; GetSwapStartHook func() func(.uverse.realm, string, int64); GetTickCrossHook func() func(.uverse.realm, string, int32, bool, int64); GetUnlocked func() bool; GetWithdrawalFeeBPS func() uint64; HasFeeAmountTickSpacing func() bool; HasObservations func() bool; HasPendingProtocolFees func() bool; HasPoolCreationFee func() bool; HasPools func() bool; HasSlot0FeeProtocol func() bool; HasSwapEndHook func() bool; HasSwapStartHook func() bool; HasTickCrossHook func() bool; HasUnlocked func() bool; HasWithdrawalFeeBPS func() bool; RemovePendingProtocolFee func(int, .uverse.realm, string) .uverse.error; SetFeeAmountTickSpacing func(int, .uverse.realm, map[uint32]int32) .uverse.error; SetObservations func(int, .uverse.realm, *gno.land/p/nt/bptree/v0.BPTree) .uverse.error; SetPendingProtocolFee func(int, .uverse.realm, string, int64) .uverse.error; SetPendingProtocolFees func(int, .uverse.realm, map[string]int64) .uverse.error; SetPoolCreationFee func(int, .uverse.realm, int64) .uverse.error; SetPools func(int, .uverse.realm, *gno.land/p/nt/bptree/v0.BPTree) .uverse.error; SetSlot0FeeProtocol func(int, .uverse.realm, uint8) .uverse.error; SetSwapEndHook func(int, .uverse.realm, func(.uverse.realm, string) .uverse.error) .uverse.error; SetSwapStartHook func(int, .uverse.realm, func(.uverse.realm, string, int64)) .uverse.error; SetTickCrossHook func(int, .uverse.realm, func(.uverse.realm, string, int32, bool, int64)) .uverse.error; SetUnlocked func(int, .uverse.realm, bool) .uverse.error; SetWithdrawalFeeBPS func(int, .uverse.realm, uint64) .uverse.error}

    • NewPoolsTree() *gno.land/p/nt/bptree/v0.BPTree

    • NewPoolTicksTree() *gno.land/p/nt/bptree/v0.BPTree

    • NewPositionInfo() struct{liquidity string; feeGrowthInside0LastX128 string; feeGrowthInside1LastX128 string; tokensOwed0 int64; tokensOwed1 int64}

    • NewSlot0(sqrtPriceX96 *gno.land/p/gnoswap/uint256/v1.Uint, tick int32, feeProtocol uint8, unlocked bool) struct{sqrtPriceX96 *gno.land/p/gnoswap/uint256/v1.Uint; tick int32; feeProtocol uint8; unlocked bool; observationIndex uint16; observationCardinality uint16; observationCardinalityNext uint16}

    • NewTickInfo() struct{liquidityGross string; liquidityNet string; feeGrowthOutside0X128 string; feeGrowthOutside1X128 string; tickCumulativeOutside int64; secondsPerLiquidityOutsideX128 string; secondsOutside uint32; initialized bool}

    • NewTokenPair() struct{token0 int64; token1 int64}

    • Observe(poolPath string, secondsAgos []uint32) ([]int64, []string, interface {Error func() string})

    • OracleConsult(poolPath string, secondsAgo uint32) (int32, string, interface {Error func() string})

    • RegisterInitializer(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, initializer func(int, .uverse.realm, gno.land/r/gnoswap/pool.IPoolStore) gno.land/r/gnoswap/pool.IPool)

    • Render(path string) string

    • SetFeeProtocol(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, feeProtocol0 uint8, feeProtocol1 uint8)

    • SetPoolCreationFee(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, fee int64)

    • SetSwapEndHook(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, hook func(.uverse.realm, string) .uverse.error)

    • SetSwapStartHook(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, hook func(.uverse.realm, string, int64))

    • SetTickCrossHook(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, hook func(.uverse.realm, string, int32, bool, int64))

    • SetWithdrawalFee(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, fee uint64)

    • SnapshotCumulativesInside(poolPath string, tickLower int32, tickUpper int32) (int64, string, uint32, interface {Error func() string})

    • Swap(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, token0Path string, token1Path string, fee uint32, recipient string, zeroForOne bool, amountSpecified string, sqrtPriceLimitX96 string, swapCallback func(.uverse.realm, int64, int64, *gno.land/r/gnoswap/pool.CallbackMarker) .uverse.error) (string, string)

    • UpgradeImpl(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, packagePath string)

    Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.

    Rendered

    RenderedRawgnoweb ↗

    vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.