Merge pull request #1429 from c9s/edwin/bybit/get-fee-rate-on-private-stream-only

This commit is contained in:
c9s 2023-12-13 18:50:19 +08:00 committed by GitHub
commit 2c7e42922b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)