Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllLatestPrices ¶
func GetAllLatestPrices( ctx context.Context, pythClient client.Hermes, qs *Settings, pairIndexes map[string]uint64, oracleFeeds map[string][]string, uniqueFeeds []string, ) (lib.PriceUpdates, error)
Requires a Pyth client to fetch prices from Pyth Hermes API. Assumes that all required feeds to be queried for `oracleFeeds` are in the `uniqueFeeds` slice.
func GetAllPricesAt ¶
func GetAllPricesAt( ctx context.Context, timestamp time.Time, pythClient client.Benchmarks, qs *Settings, pairIndexes map[string]uint64, oracleFeeds map[string][]string, uniqueFeeds []string, ) (lib.PriceUpdates, error)
Requires a Pyth client to fetch prices from Pyth Benchmarks API. Assumes that all required feeds to be queried for `oracleFeeds` are in the `uniqueFeeds` slice.
Types ¶
type Settings ¶
Settings is a struct that holds the settings for querying Hermes using the Pythnet client.
type Type ¶
type Type string
Type is an enum that represents the type of query to be made to the Pythnet Hermes API.
const ( // LatestSync is a query type that fetches all latest prices together & synchronously. LatestSync Type = "latest-sync" // LatestAsync is a query type that fetches all latest prices individually, in parallel. LatestAsync Type = "latest-async" // Stream is a query type that subscribes to price updates and returns the latest cached price. StreamCached Type = "stream" )
Click to show internal directories.
Click to hide internal directories.