Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BybitDetails = types.ExchangeQueryDetails{ Exchange: exchange_common.EXCHANGE_ID_BYBIT, Url: "https://api.bybit.com/v5/market/tickers?category=spot", PriceFunction: BybitPriceFunction, IsMultiMarket: true, } )
Functions ¶
func BybitPriceFunction ¶
func BybitPriceFunction( response *http.Response, tickerToExponent map[string]int32, medianizer lib.Medianizer, ) (tickerToPrice map[string]uint64, unavailableTickers map[string]error, err error)
BybitPriceFunction transforms an API response from Bybit into a map of tickers to prices that have been shifted by a market specific exponent.
Types ¶
type BybitResponseBody ¶
type BybitResponseBody struct { RetCode uint32 `json:"retCode" validate:"required"` Result BybitResponseResult `json:"result" validate:"required"` }
BybitResponseBody defines the overall Bybit response.
type BybitResponseResult ¶
type BybitResponseResult struct {
Tickers []BybitTicker `json:"list" validate:"required"`
}
BybitResponseResult defines the `result` field of Bybit response.
type BybitTicker ¶
type BybitTicker struct { Pair string `json:"symbol" validate:"required"` AskPrice string `json:"ask1Price" validate:"required,positive-float-string"` BidPrice string `json:"bid1Price" validate:"required,positive-float-string"` LastPrice string `json:"lastPrice" validate:"required,positive-float-string"` }
BybitTicker is our representation of ticker information returned in Bybit response. Need to implement interface `Ticker` in util.go.
func (BybitTicker) GetAskPrice ¶
func (t BybitTicker) GetAskPrice() string
func (BybitTicker) GetBidPrice ¶
func (t BybitTicker) GetBidPrice() string
func (BybitTicker) GetLastPrice ¶
func (t BybitTicker) GetLastPrice() string
func (BybitTicker) GetPair ¶
func (t BybitTicker) GetPair() string
Click to show internal directories.
Click to hide internal directories.