Documentation ¶
Overview ¶
Package quotes implements multiple price feed adapters.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DriverBinance = DriverType{"binance"} DriverKraken = DriverType{"kraken"} DriverOpendax = DriverType{"opendax"} DriverBitfaker = DriverType{"bitfaker"} DriverUniswapV3Api = DriverType{"uniswap_v3_api"} DriverUniswapV3Geth = DriverType{"uniswap_v3_geth"} DriverSyncswap = DriverType{"syncswap"} )
View Source
var ( TakerTypeUnknown = TakerType{""} TakerTypeBuy = TakerType{"sell"} TakerTypeSell = TakerType{"buy"} )
Functions ¶
This section is empty.
Types ¶
type BinanceConfig ¶ added in v0.0.23
type BinanceConfig struct {
TradeSampler TradeSamplerConfig `yaml:"trade_sampler"`
}
func (BinanceConfig) DriverType ¶ added in v0.0.23
func (BinanceConfig) DriverType() DriverType
type BitfakerConfig ¶ added in v0.0.23
type BitfakerConfig struct { Period time.Duration `yaml:"period" env:"QUOTES_BITFAKER_PERIOD" env-default:"5s"` TradeSampler TradeSamplerConfig `yaml:"trade_sampler"` }
func (BitfakerConfig) DriverType ¶ added in v0.0.23
func (BitfakerConfig) DriverType() DriverType
type Config ¶
type Config interface {
DriverType() DriverType
}
func NewConfigFromEnv ¶ added in v0.0.22
func NewConfigFromEnv(driver DriverType) (Config, error)
type Driver ¶
type DriverType ¶
type DriverType struct {
// contains filtered or unexported fields
}
DriverType is enum that represents all available quotes providers.
func ToDriverType ¶
func ToDriverType(raw string) (DriverType, error)
func (DriverType) MarshalJSON ¶
func (t DriverType) MarshalJSON() ([]byte, error)
func (DriverType) MarshalYAML ¶
func (t DriverType) MarshalYAML() (any, error)
func (DriverType) String ¶
func (d DriverType) String() string
func (*DriverType) UnmarshalJSON ¶
func (t *DriverType) UnmarshalJSON(raw []byte) error
func (*DriverType) UnmarshalYAML ¶
func (t *DriverType) UnmarshalYAML(value *yaml.Node) error
type KrakenConfig ¶ added in v0.0.23
type KrakenConfig struct { URL string `yaml:"url" env:"QUOTES_KRAKEN_URL" env-default:"wss://ws.kraken.com"` ReconnectPeriod time.Duration `yaml:"period" env:"QUOTES_KRAKEN_RECONNECT_PERIOD" env-default:"5s"` TradeSampler TradeSamplerConfig `yaml:"trade_sampler"` }
func (KrakenConfig) DriverType ¶ added in v0.0.23
func (KrakenConfig) DriverType() DriverType
type OpendaxConfig ¶ added in v0.0.23
type OpendaxConfig struct { URL string `yaml:"url" env:"QUOTES_OPENDAX_URL" env-default:"wss://alpha.yellow.org/api/v1/finex/ws"` ReconnectPeriod time.Duration `yaml:"period" env:"QUOTES_OPENDAX_RECONNECT_PERIOD" env-default:"5s"` TradeSampler TradeSamplerConfig `yaml:"trade_sampler"` }
func (OpendaxConfig) DriverType ¶ added in v0.0.23
func (OpendaxConfig) DriverType() DriverType
type SyncswapConfig ¶ added in v0.0.23
type SyncswapConfig struct { URL string `yaml:"url" env:"QUOTES_SYNCSWAP_URL" env-default:""` AssetsURL string `` /* 152-byte string literal not displayed */ ClassicPoolFactoryAddress string `` /* 143-byte string literal not displayed */ TradeSampler TradeSamplerConfig `yaml:"trade_sampler"` }
func (SyncswapConfig) DriverType ¶ added in v0.0.23
func (SyncswapConfig) DriverType() DriverType
type TakerType ¶
type TakerType struct {
// contains filtered or unexported fields
}
TakerType is enum that represents the side of taker in a trade.
func ToTakerType ¶
func (TakerType) MarshalJSON ¶
func (TakerType) MarshalYAML ¶
func (*TakerType) UnmarshalJSON ¶
func (*TakerType) UnmarshalYAML ¶
type TradeEvent ¶
type TradeEvent struct { Source DriverType Market string // e.g. `btc/usdt` Price decimal.Decimal Amount decimal.Decimal Total decimal.Decimal TakerType TakerType CreatedAt time.Time }
TradeEvent is a generic container for trades received from providers.
type TradeSamplerConfig ¶
type UniswapV3ApiConfig ¶ added in v0.0.23
type UniswapV3ApiConfig struct { URL string `yaml:"url" env:"QUOTES_UNISWAP_V3_API_URL" env-default:"https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3"` WindowSize time.Duration `yaml:"window_size" env:"QUOTES_UNISWAP_V3_API_WINDOW_SIZE" env-default:"2s"` TradeSampler TradeSamplerConfig `yaml:"trade_sampler"` }
func (UniswapV3ApiConfig) DriverType ¶ added in v0.0.23
func (UniswapV3ApiConfig) DriverType() DriverType
type UniswapV3GethConfig ¶ added in v0.0.23
type UniswapV3GethConfig struct { URL string `yaml:"url" env:"QUOTES_UNISWAP_V3_GETH_URL" env-default:""` AssetsURL string `` /* 159-byte string literal not displayed */ FactoryAddress string `yaml:"factory_address" env:"QUOTES_UNISWAP_V3_GETH_FACTORY_ADDRESS" env-default:"0x1F98431c8aD98523631AE4a59f267346ea31F984"` TradeSampler TradeSamplerConfig `yaml:"trade_sampler"` }
func (UniswapV3GethConfig) DriverType ¶ added in v0.0.23
func (UniswapV3GethConfig) DriverType() DriverType
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Types and helpers for easy formatting and parsing open-finance protocol messages.
|
Types and helpers for easy formatting and parsing open-finance protocol messages. |
App for testing quotes drivers.
|
App for testing quotes drivers. |
Click to show internal directories.
Click to hide internal directories.