jaggedsoft / node-binance-api

Node Binance API is an asynchronous node.js library for the Binance API designed to be easy to use.
MIT License
1.57k stars 767 forks source link

websockets depthCacheStaggered reconnect does not wait #874

Open kiukishenkaec opened 1 year ago

kiukishenkaec commented 1 year ago

We are currently monitoring 300+ symbols. Depth 1000 (weight 10). There is a delay in queries during script start. But when reconnecting the websocket, everything collapses.

When reconnecting ( Binance.options.reconnect == true), the time between requests is not respected. Therefore, we run into the limitation of api binance 1200 wight 1 Can it check during reconnection and not send depth requests again, but only reconnect via websocket?

Do something like the following. Replace: before if ( Binance.options.reconnect ) depthCacheFunction( symbols, callback, limit ); after if ( Binance.options.reconnect ) depth( symbols, callback );