From 9f83165032ae515f91643bc9c8c2a6817126720f Mon Sep 17 00:00:00 2001 From: Edwin Date: Tue, 26 Sep 2023 16:07:54 +0800 Subject: [PATCH] pkg/exchange: use balance update instead of snapshot event --- pkg/exchange/bybit/stream.go | 2 +- pkg/exchange/bybit/stream_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/exchange/bybit/stream.go b/pkg/exchange/bybit/stream.go index eab0c83e7..145591cac 100644 --- a/pkg/exchange/bybit/stream.go +++ b/pkg/exchange/bybit/stream.go @@ -385,7 +385,7 @@ func (s *Stream) handleMarketTradeEvent(events []MarketTradeEvent) { } func (s *Stream) handleWalletEvent(events []bybitapi.WalletBalances) { - s.StandardStream.EmitBalanceSnapshot(toGlobalBalanceMap(events)) + s.StandardStream.EmitBalanceUpdate(toGlobalBalanceMap(events)) } func (s *Stream) handleOrderEvent(events []OrderEvent) { diff --git a/pkg/exchange/bybit/stream_test.go b/pkg/exchange/bybit/stream_test.go index 8e322a439..7cfc4d99b 100644 --- a/pkg/exchange/bybit/stream_test.go +++ b/pkg/exchange/bybit/stream_test.go @@ -135,8 +135,8 @@ func TestStream(t *testing.T) { err := s.Connect(context.Background()) assert.NoError(t, err) - s.OnBalanceSnapshot(func(balances types.BalanceMap) { - t.Log("got snapshot", balances) + s.OnBalanceUpdate(func(balances types.BalanceMap) { + t.Log("got update", balances) }) c := make(chan struct{}) <-c