crypto_alert_bot/internal/provider/bybit/models.go

32 lines
1.2 KiB
Go

package bybit
const (
categorySpot string = "spot"
categoryLinear string = "linear"
categoryInverse string = "inverse"
categoryOption string = "option"
)
type marketOrderbookReq struct {
// Product type. spot, linear, inverse, option
Category string `json:"category"`
// Symbol name, like BTCUSDT, uppercase only
Symbol string `json:"symbol"`
/*
Limit size for each bid and ask
spot: [1, 200]. Default: 1.
linear&inverse: [1, 500]. Default: 25.
option: [1, 25]. Default: 1.
*/
Limit *int `json:"limit,omitempty"`
}
type marketOrderbookResp struct {
S string `json:"s"` // Symbol name.
A [][]string `json:"a"` // Ask, seller. Sorted by price in ascending order. a[0]: Ask price, a[1]: Ask size.
B [][]string `json:"b"` // Bid, buyer. Sorted by price in descending order. b[0]: Bid price, b[1]: Bid size.
Ts int64 `json:"ts"` // The timestamp (ms) that the system generates the data.
U int `json:"u"` // Update ID, is always in sequence.
Seq int `json:"seq"` // Cross sequence.
Cts int64 `json:"cts"` // The timestamp from the matching engine when this orderbook data is produced. It can be correlated with T from public trade channel.
}