spectre

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const LoggerTag = "SPECTRE"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Signer ethereum.Signer
	// Datastore provides prices for Spectre.
	Datastore datastore.Datastore
	// Interval describes how often we should try to update Oracles.
	Interval time.Duration
	// Pairs is the list supported pairs by Spectre with their configuration.
	Pairs []*Pair
	// Logger is a current logger interface used by the Spectre. The Logger is
	// required to monitor asynchronous processes.
	Logger log.Logger
}

type Pair

type Pair struct {
	// AssetPair is the name of asset pair, e.g. ETHUSD.
	AssetPair string
	// OracleSpread is the minimum spread between the Oracle price and new price
	// required to send update.
	OracleSpread float64
	// OracleExpiration is the minimum time difference between the Oracle time
	// and current time required to send an update.
	OracleExpiration time.Duration
	// PriceExpiration is the maximum amount of time before price received
	// from the feeder will be considered as expired.
	PriceExpiration time.Duration
	// Median is the instance of the oracle.Median which is the interface for
	// the Oracle contract.
	Median oracle.Median
}

type Spectre

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

func NewSpectre

func NewSpectre(ctx context.Context, cfg Config) (*Spectre, error)

func (*Spectre) Start

func (s *Spectre) Start() error

func (*Spectre) Wait

func (s *Spectre) Wait() chan error

Wait waits until the context is canceled or until an error occurs.

Jump to

Keyboard shortcuts

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