From 214f9fe75e2621942836756c73e5aa65aa509edb Mon Sep 17 00:00:00 2001 From: c9s Date: Thu, 7 Dec 2023 16:31:37 +0800 Subject: [PATCH] bitget: improve bitget websocket depth subscription --- pkg/exchange/bitget/stream.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/exchange/bitget/stream.go b/pkg/exchange/bitget/stream.go index 864b5ba24..4d8ec96a8 100644 --- a/pkg/exchange/bitget/stream.go +++ b/pkg/exchange/bitget/stream.go @@ -75,7 +75,7 @@ func (s *Stream) syncSubscriptions(opType WsEventType) error { } logger := log.WithField("opType", opType) - args := []WsArg{} + var args []WsArg for _, subscription := range s.Subscriptions { arg, err := convertSubscription(subscription) if err != nil { @@ -244,9 +244,11 @@ func convertSubscription(sub types.Subscription) (WsArg, error) { arg.Channel = ChannelOrderBook5 switch sub.Options.Depth { - case types.DepthLevel15: + case types.DepthLevel5: + arg.Channel = ChannelOrderBook5 + case types.DepthLevel15, types.DepthLevelMedium: arg.Channel = ChannelOrderBook15 - case types.DepthLevel200: + case types.DepthLevel200, types.DepthLevelFull: log.Warn("*** The subscription events for the order book may return fewer than 200 bids/asks at a depth of 200. ***") arg.Channel = ChannelOrderBook }