oracle

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// SymbolETH refers to the ethereum symbol.
	SymbolETH = "ETH"
)

Variables

This section is empty.

Functions

func GetStablecoinsCurrencyPair

func GetStablecoinsCurrencyPair(baseSymbol string) []umeepftypes.CurrencyPair

GetStablecoinsCurrencyPair return the currency pair of that symbol quoted by some stablecoins.

Types

type Oracle

type Oracle struct {
	// contains filtered or unexported fields
}

Oracle implements the core component responsible for fetching exchange rates for a given set of currency pairs and determining the correct exchange rates.

func New

func New(ctx context.Context, logger zerolog.Logger, providersName []pfprovider.Name) (*Oracle, error)

func (*Oracle) GetPrice

func (o *Oracle) GetPrice(baseSymbol string) (sdk.Dec, error)

GetPrice returns the price based on the symbol ex.: UMEE, ETH.

func (*Oracle) GetPrices

func (o *Oracle) GetPrices(baseSymbols ...string) (map[string]sdk.Dec, error)

GetPrices returns the price for the provided base symbols.

func (*Oracle) Stop

func (o *Oracle) Stop()

Stop stops the oracle process and waits for it to gracefully exit.

func (*Oracle) SubscribeSymbols

func (o *Oracle) SubscribeSymbols(baseSymbols ...string) error

SubscribeSymbols attempts to subscribe the symbols in all the providers. baseSymbols is the base to be subscribed ex.: ["UMEE", "ATOM"].

type Provider

type Provider struct {
	pfprovider.Provider
	// contains filtered or unexported fields
}

Provider wraps the umee provider interface.

Jump to

Keyboard shortcuts

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