spectre

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: AGPL-3.0 Imports: 13 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
	// 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 Datastore

type Datastore interface {
	Prices() *datastore.PriceStore
	Start() error
	Stop() error
}

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(cfg Config) *Spectre

func (*Spectre) Start

func (r *Spectre) Start() error

func (*Spectre) Stop

func (r *Spectre) Stop() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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