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"} DriverUniswapV3 = DriverType{"uniswap_v3"} )
View Source
var ( TakerTypeUnknown = TakerType{""} TakerTypeBuy = TakerType{"sell"} TakerTypeSell = TakerType{"buy"} )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { URL string `yaml:"url" env:"QUOTES_URL" env-default:""` Driver DriverType `yaml:"driver" env:"QUOTES_DRIVER" env-default:"binance"` ReconnectPeriod time.Duration `yaml:"period" env:"QUOTES_RECONNECT_PERIOD" env-default:"5s"` TradeSampler TradeSamplerConfig `yaml:"trade_sampler"` }
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 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. `btcusdt` 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 ¶
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. |
Click to show internal directories.
Click to hide internal directories.