mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-03 23:16:53 +00:00
Kraken: fix websocket orderbook processing (#1279)
* kraken: fix websocket orderbook processing * kraken: clean * glorious: nits also add todo * more: add required checksum to TODO for future, move variable to top * glorious: get mad * orderbook: fix retrieve issue --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
This commit is contained in:
@@ -67,7 +67,6 @@ func (b *Bittrex) ProcessUpdateOB(pair currency.Pair, message *OrderbookUpdateMe
|
||||
Asset: asset.Spot,
|
||||
Pair: pair,
|
||||
UpdateID: message.Sequence,
|
||||
MaxDepth: orderbookDepth,
|
||||
Bids: updateBids,
|
||||
Asks: updateAsks,
|
||||
})
|
||||
@@ -115,11 +114,11 @@ func (b *Bittrex) SeedLocalOBCache(ctx context.Context, p currency.Pair) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return b.SeedLocalCacheWithOrderBook(p, sequence, ob)
|
||||
return b.SeedLocalCacheWithOrderBook(p, sequence, ob, orderbookDepth)
|
||||
}
|
||||
|
||||
// SeedLocalCacheWithOrderBook seeds the local orderbook cache
|
||||
func (b *Bittrex) SeedLocalCacheWithOrderBook(p currency.Pair, sequence int64, orderbookNew *OrderbookData) error {
|
||||
func (b *Bittrex) SeedLocalCacheWithOrderBook(p currency.Pair, sequence int64, orderbookNew *OrderbookData, maxDepth int) error {
|
||||
newOrderBook := orderbook.Base{
|
||||
Pair: p,
|
||||
Asset: asset.Spot,
|
||||
@@ -128,6 +127,7 @@ func (b *Bittrex) SeedLocalCacheWithOrderBook(p currency.Pair, sequence int64, o
|
||||
VerifyOrderbook: b.CanVerifyOrderbook,
|
||||
Bids: make(orderbook.Items, len(orderbookNew.Bid)),
|
||||
Asks: make(orderbook.Items, len(orderbookNew.Ask)),
|
||||
MaxDepth: maxDepth,
|
||||
}
|
||||
|
||||
for i := range orderbookNew.Bid {
|
||||
|
||||
Reference in New Issue
Block a user