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
  • utils.gnogno
    1package pool23import (4	"strconv"5	"strings"67	"gno.land/p/gnoswap/utils/v1"8)910const MAX_TICK int32 = 8872721112// GetPoolPath generates a unique pool path string based on the token paths and fee tier.13// Parameters:14//   - token0Path: path of the first token contract; it is reordered with15//     token1Path when needed to form canonical pool order.16//   - token1Path: path of the second token contract; it is reordered with17//     token0Path when it sorts earlier.18//   - fee: pool fee tier encoded as its decimal uint32 value in the path.19//20// Returns:21//   - poolPath: canonical token0:token1:fee identifier with token paths in22//     lexicographical order.23func GetPoolPath(token0Path, token1Path string, fee uint32) string {24	// All the token paths in the pool are sorted in alphabetical order.25	if strings.Compare(token1Path, token0Path) < 0 {26		token0Path, token1Path = token1Path, token0Path27	}2829	return token0Path + ":" + token1Path + ":" + strconv.FormatUint(uint64(fee), 10)30}3132// EncodeTickKey encodes a tick as a fixed-width 4-byte key whose33// lexicographic order matches the signed numeric order.34// Parameters:35//   - tick: signed tick index to encode.36//37// Returns:38//   - key: fixed-width ordered key whose lexicographical ordering matches the39//     signed numeric ordering of tick.40func EncodeTickKey(tick int32) string {41	return utils.EncodeInt32(tick)42}4344// EncodePositionKey encodes a position range as two ordered tick keys.45// Parameters:46//   - tickLower: lower signed tick index of the position range.47//   - tickUpper: upper signed tick index of the position range.48//49// Returns:50//   - key: concatenation of the ordered encodings of tickLower and tickUpper.51func EncodePositionKey(tickLower, tickUpper int32) string {52	return utils.EncodeInt32(tickLower) + utils.EncodeInt32(tickUpper)53}5455// DecodeTickKey decodes a fixed-width ordered tick key.56// Parameters:57//   - key: fixed-width ordered tick key produced by EncodeTickKey.58//59// Returns:60//   - tick: signed tick index decoded from key.61func DecodeTickKey(key string) int32 {62	return utils.DecodeInt32(key)63}64

    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.