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

SnapshotCumulativesInside

func SnapshotCumulativesInside( poolPath string, tickLower int32, tickUpper int32, ) (int64, string, uint32, error)

SnapshotCumulativesInside returns the tick, seconds-per-liquidity, and seconds cumulatives accrued while the pool price was inside [tickLower, tickUpper). Both boundary ticks must be initialized.

Snapshots are only comparable across an interval during which a position in the range existed, matching Uniswap V3's snapshotCumulativesInside. Parameters:

  • poolPath: Canonical pool path whose oracle snapshot is queried.
  • tickLower: Lower inclusive tick boundary of the position range.
  • tickUpper: Upper exclusive tick boundary of the position range; both boundary ticks must be initialized.

Returns:

  • int64: Tick cumulative accrued while the price was inside the range.
  • string: Seconds-per-liquidity-inside X128 accumulator, serialized as a base-10 string.
  • uint32: Seconds accrued while the price was inside the range.
  • error: Non-nil when the pool, observations, or initialized boundaries are unavailable.

Params

Command

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

Result