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
  • oracle.gnogno
    1package pool23import (4	"gno.land/p/gnoswap/utils/v1"5	"gno.land/p/nt/bptree/v0"6)78

    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 ↗
    type
    Observation
    struct
    {
    9 blockTimestamp int64 // timestamp of the observation
    10 tickCumulative int64 // cumulative tick up to this timestamp
    11 secondsPerLiquidityCumulativeX128 string // cumulative seconds per liquidity
    12 initialized bool // whether this observation has been initialized
    13}
    14
    15// Observation getter methods.
    16// BlockTimestamp returns the observation's block timestamp.
    17//
    18// Returns:
    19// - blockTimestamp: Timestamp at which this observation was recorded.
    20func (o Observation) BlockTimestamp() int64 { return o.blockTimestamp }
    21
    22// TickCumulative returns the signed cumulative tick recorded by the observation.
    23//
    24// Returns:
    25// - tickCumulative: Cumulative tick value through the observation timestamp.
    26func (o Observation) TickCumulative() int64 { return o.tickCumulative }
    27
    28// SecondsPerLiquidityCumulativeX128 returns the Q128-encoded cumulative
    29// seconds-per-liquidity value recorded by the observation.
    30//
    31// Returns:
    32// - secondsPerLiquidityCumulativeX128: Decimal string containing the cumulative value scaled by 2^128.
    33func (o Observation) SecondsPerLiquidityCumulativeX128() string {
    34 return o.secondsPerLiquidityCumulativeX128
    35}
    36
    37// Initialized reports whether the observation contains initialized oracle data.
    38//
    39// Returns:
    40// - initialized: True when the observation slot has been initialized; false for an empty slot.
    41func (o Observation) Initialized() bool { return o.initialized }
    42
    43// MakeObservation constructs an observation from its stored oracle accumulators.
    44//
    45// Parameters:
    46// - blockTimestamp: Timestamp associated with the observation.
    47// - tickCumulative: Signed cumulative tick at blockTimestamp.
    48// - secondsPerLiquidityCumulativeX128: Decimal Q128-scaled cumulative seconds-per-liquidity value.
    49// - initialized: Whether this observation slot is initialized and usable.
    50//
    51// Returns:
    52// - observation: Observation containing the supplied timestamp, accumulators, and initialization flag.
    53func MakeObservation(
    54 blockTimestamp int64,
    55 tickCumulative int64,
    56 secondsPerLiquidityCumulativeX128 string,
    57 initialized bool,
    58) Observation {
    59 return Observation{
    60 blockTimestamp: blockTimestamp,
    61 tickCumulative: tickCumulative,
    62 secondsPerLiquidityCumulativeX128: secondsPerLiquidityCumulativeX128,
    63 initialized: initialized,
    64 }
    65}
    66
    67// DefaultObservation returns the zero, uninitialized observation used for an empty slot.
    68//
    69// Returns:
    70// - observation: Observation with zero timestamp and accumulators and Initialized false.
    71func DefaultObservation() Observation {
    72 return MakeObservation(
    73 0,
    74 0,
    75 "0",
    76 false,
    77 )
    78}
    79
    80// ObservationTree is a pool-local oracle ring buffer keyed by index.
    81// It owns the B+tree key encoding so oracle code works with uint16 indices.
    82type ObservationTree struct {
    83 tree *bptree.BPTree
    84}
    85
    86// NewObservationTree creates an empty pool-local observation tree keyed by uint16 index.
    87//
    88// Returns:
    89// - tree: Initialized observation tree ready for Get, Set, and Has operations.
    90func NewObservationTree() *ObservationTree {
    91 return &ObservationTree{tree: bptree.NewBPTreeN(32)}
    92}
    93
    94// Get looks up an observation by its circular-buffer index.
    95//
    96// Parameters:
    97// - index: uint16 observation slot to read.
    98//
    99// Returns:
    100// - observation: Stored observation when the tree contains a value of the expected type; otherwise the zero observation.
    101// - ok: True when a stored value was found and decoded as an Observation; false for nil/uninitialized trees, missing slots, or a type mismatch.
    102func (t *ObservationTree) Get(index uint16) (Observation, bool) {
    103 if t == nil || t.tree == nil {
    104 return Observation{}, false
    105 }
    106 value := t.tree.Get(utils.EncodeUint16(index))
    107 if value == nil {
    108 return Observation{}, false
    109 }
    110 observation, ok := value.(Observation)
    111 return observation, ok
    112}
    113
    114// Set stores an observation at a circular-buffer index.
    115//
    116// Parameters:
    117// - index: uint16 observation slot to write.
    118// - observation: Observation value to associate with index.
    119func (t *ObservationTree) Set(index uint16, observation Observation) {
    120 if t == nil || t.tree == nil {
    121 panic("observation tree is not initialized")
    122 }
    123 t.tree.Set(utils.EncodeUint16(index), observation)
    124}
    125
    126// Has reports whether an observation slot exists in the tree.
    127//
    128// Parameters:
    129// - index: uint16 observation slot to test.
    130//
    131// Returns:
    132// - exists: True when the initialized tree contains index; false for nil/uninitialized trees or an absent slot.
    133func (t *ObservationTree) Has(index uint16) bool {
    134 if t == nil || t.tree == nil {
    135 return false
    136 }
    137 return t.tree.Has(utils.EncodeUint16(index))
    138}
    139
    140// NewObservationsTree creates the top-level B+tree that indexes pool observation trees by pool path.
    141//
    142// Returns:
    143// - tree: Empty B+tree suitable for storing pool-path observation trees.
    144func NewObservationsTree() *bptree.BPTree {
    145 return bptree.NewBPTreeN(32)
    146}
    147
    148// NewPoolObservationsTree creates a circular observation buffer with slot zero initialized.
    149//
    150// Parameters:
    151// - currentTime: Timestamp assigned to the initial observation at index zero.
    152//
    153// Returns:
    154// - tree: Observation tree containing an initialized zero-index observation with zero cumulative values.
    155func NewPoolObservationsTree(currentTime int64) *ObservationTree {
    156 observations := NewObservationTree()
    157 observations.Set(0, MakeObservation(
    158 currentTime,
    159 0,
    160 "0",
    161 true,
    162 ))
    163 return observations
    164}
    165

    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.