feeds

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 1 Imported by: 0

README

Pyth Price Feeds

More information about the Pyth price feeds can be found here.

Current Supported Feed Ecosystems

  • EVM Stable
    • All are supported.
  • EVM Beta
    • If you want to add more feeds, please follow the pattern in evm_stable.go.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EVMBetaFeedsToIDs = map[string]string{
	"BTC/USD":  "f9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b",
	"ETH/USD":  "ca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a6",
	"ATOM/USD": "61226d39beea19d334f17c2febce27e12646d84675924ebb02b9cdaea68727e3",
	"TIA/USD":  "30998099c161c4f04b48569485cfab66256f36006810fe787f40fbc96e263438",
	"USDC/USD": "41f3625971ca2ed2263e78573fe5ce23e13d2558ed3f2e47ab0f84fb9e7ae722",
}
View Source
var EVMBetaIDsToFeeds = map[string]string{
	"f9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b": "BTC/USD",
	"ca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a6": "ETH/USD",
	"61226d39beea19d334f17c2febce27e12646d84675924ebb02b9cdaea68727e3": "ATOM/USD",
	"30998099c161c4f04b48569485cfab66256f36006810fe787f40fbc96e263438": "TIA/USD",
	"41f3625971ca2ed2263e78573fe5ce23e13d2558ed3f2e47ab0f84fb9e7ae722": "USDC/USD",
}
View Source
var EVMStableFeedsToIDs = map[string]string{}/* 508 elements not displayed */
View Source
var EVMStableIDsToFeeds = map[string]string{}/* 508 elements not displayed */

Functions

func AddHexPrefix added in v1.0.2

func AddHexPrefix(str string) string

AddHexPrefix adds a '0x' prefix to a string if it doesn't already have one.

func MustGetPriceFeed

func MustGetPriceFeed(version Version, id string) string

MustGetPriceFeed converts a price feed ID string to a ticker string. Panics if the price feed ID is not supported.

func MustGetPriceFeedID

func MustGetPriceFeedID(version Version, ticker string) string

MustGetPriceFeedID converts a ticker string to a price feed ID string. Panics if the ticker is not supported.

Types

type Version

type Version int8

Enum for Pyth supported price feed ecosystems.

const (
	InvalidFeed Version = iota - 1
	EVMStable
	EVMBeta
)

func ToVersion

func ToVersion(ecosystem string) (Version, error)

ToVersion converts a ecosystem string to a Version enum.

Jump to

Keyboard shortcuts

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