init; project structure & bybit provider
This commit is contained in:
commit
ae096d4820
14 changed files with 482 additions and 0 deletions
32
internal/provider/bybit/models.go
Normal file
32
internal/provider/bybit/models.go
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
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.
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue