From 29550f0013f23459b1946b3f3f7a15fa8e18c1e7 Mon Sep 17 00:00:00 2001 From: Edwin Date: Wed, 22 Nov 2023 16:08:07 +0800 Subject: [PATCH] pkg/exchange: we don't need the fee rate in the public stream --- pkg/exchange/bybit/stream.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/exchange/bybit/stream.go b/pkg/exchange/bybit/stream.go index 3b61661943..fd09ec4c8f 100644 --- a/pkg/exchange/bybit/stream.go +++ b/pkg/exchange/bybit/stream.go @@ -85,6 +85,12 @@ func NewStream(key, secret string, userDataProvider StreamDataProvider) *Stream stream.SetDispatcher(stream.dispatchEvent) stream.SetHeartBeat(stream.ping) stream.SetBeforeConnect(func(ctx context.Context) (err error) { + if stream.PublicOnly { + // we don't need the fee rate in the public stream. + return + } + + // get account fee rate go stream.feeRateProvider.Start(ctx) stream.marketsInfo, err = stream.streamDataProvider.QueryMarkets(ctx)