price

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const BLOCK_INTERVAL_SEC = 5
View Source
const NA_VALUE = int64(-1)

Variables

This section is empty.

Functions

This section is empty.

Types

type Price

type Price interface {
	CurrHeight() (int64, error)
	NextHeight(minHeight uint64) (int64, error)
	Run(height uint64) error
}

func New

func New(repo SrcRepo, priceToken string, logger logging.Logger) (Price, error)

type SrcRepo

type SrcRepo interface {
	FirstHeight(priceToken string) (int64, error)
	CurrHeight() (int64, error)
	NextHeight(minHeight uint64) (int64, error)
	Txs(height uint64) ([]schemas.ParsedTx, error)
	Decimals(asset string) (int64, error)
	LatestRouteUpdateTimestamp() (float64, error)
	Route(endToken string) (map[string][][]string, error)
	Liquidity(height uint64, token string, priceToken string) (string, string, error)
	UpdateDirectPrice(height uint64, token string, price string, priceToken string, isReverse bool) error
	UpdateRoutePrice(height uint64, token string, price string, priceToken string, route []string) error
}

func NewRepo

func NewRepo(chainId string, dbConfig configs.RdbConfig) SrcRepo

Jump to

Keyboard shortcuts

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