Documentation ¶
Index ¶
Constants ¶
const RocketPoolPairETH = "RETH/ETH"
const RocketPoolPairUSD = "RETH/USD"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HookParams ¶
func NewHookParams ¶
func NewHookParams() HookParams
type Model ¶
type Model struct { // Type is used to differentiate between model types. Type string // Parameters is a optional list of model's parameters. Parameters map[string]string // Pair is a asset pair for which this model returns a price. Pair Pair // Models is a list of sub models used to calculate price. Models []*Model }
Model is a simplified representation of a model which is used to calculate asset pair prices. The main purpose of this structure is to help the end user to understand how prices are derived and calculated.
This structure is purely informational. The way it is used depends on a specific implementation.
type Pair ¶
Pair represents an asset pair.
func NewPair ¶
NewPair returns a new Pair for given string. The string must be formatted as "BASE/QUOTE".
func NewPairs ¶
NewPairs returns a Pair slice for given strings. Given strings must be formatted as "BASE/QUOTE".
func (*Pair) UnmarshalText ¶ added in v0.10.0
UnmarshalText implements encoding.TextUnmarshaler interface.
type PostPriceHook ¶
type PostPriceHook struct {
// contains filtered or unexported fields
}
func NewPostPriceHook ¶
func NewPostPriceHook( ctx context.Context, clients ethereumConfig.ClientRegistry, params HookParams, ) ( *PostPriceHook, error, )
type Price ¶
type Price struct { Type string Parameters map[string]string Pair Pair Price float64 Bid float64 Ask float64 Volume24h float64 Time time.Time Prices []*Price Error string }
Price represents price for a single pair. If the Price was calculated indirectly it will also contain all prices used to calculate the price.
type Provider ¶
type Provider interface { // Models describes price models which are used to calculate prices. // If no pairs are specified, models for all pairs are returned. Models(pairs ...Pair) (map[Pair]*Model, error) // Price returns a Price for the given pair. Price(pair Pair) (*Price, error) // Prices returns prices for the given pairs. If no pairs are specified, // prices for all pairs are returned. Prices(pairs ...Pair) (map[Pair]*Price, error) // Pairs returns all pairs. Pairs() ([]Pair, error) }
Provider provides prices for asset pairs.