indexer

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Indexer

type Indexer interface {
	// DenomTrace returns IBC Denom trace when IBC denom is provided (in the form `ibc/<hash>`)
	DenomTrace(ibc string) (ibctypes.DenomTrace, error)

	// SetLatestBlockHeight should be called at each block received
	SetLatestBlockHeight(height uint64, blockTime time.Time)

	// SetLatestPrice should be called every time a new price quote is received from price feed
	SetLatestPrice(token, base string, value float64, lastUpdated time.Time) error

	// PoolStatusesAt returns poolStatuses for a specific height given pool IDs
	PoolStatusesAt(height uint64, poolId ...uint64) ([]types.PoolStatus, uint64, error)

	// CalculateVolumes will modify poolStatuses in-place by calculating USD prices of volumes
	//
	// NOTE: volume will have two prices: actual price and price difference
	// between volume retrieved for some height and the latest height volume was retrieved for.
	CalculateVolumes(poolStatuses []types.PoolStatus) error

	// GetStatus used for telemetry and will return a map of status variables
	GetStatus() map[string]string
	AverageBlockTime() time.Duration
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL