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 package

Function

GetObservationAt

func GetObservationAt(poolPath string, index uint16) (Observation, error)

GetObservationAt returns a safe copy of the observation stored at index. An in-range but uninitialized slot returns the zero observation, matching Uniswap V3's fixed observation-array getter.

ref: uniswap v3 IUniswapV3PoolState.observations(uint256 index) Parameters:

  • poolPath: Canonical pool path identifying the pool containing the observation.
  • index: Zero-based observation-array index; values at or above the fixed cardinality bound return an error.

Returns:

  • Observation: Observation at index, or the zero observation when the slot is in range but has never been written.
  • error: Non-nil when the pool is missing or index is out of range.

Params

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/gnoswap/pool.GetObservationAt(,)"

Result