altangent / ccxws

WebSocket client for 38 cryptocurrency exchanges
MIT License
618 stars 186 forks source link

Binance ticker subscribe to AllTickers & uses a lot of bandwidth #279

Closed karimhossenbux closed 3 years ago

karimhossenbux commented 3 years ago

I was making some test with Binance yesterday night.

I figure that when subscribing to Binance ticker for a single pair, it's still subscribing to AllTickers stream causing to use a lot bandwidth (400KB/s).

And if I use 1 ticker per component, it multiply that value over and over (got it to 1200KB/s).

Here the library uses !ticker@arr which the stream for all markets: https://github.com/altangent/ccxws/blob/d4b88a761f96d4b7e4c771693ca7db9772a886b4/src/exchanges/binance-base.js#L83-L93

Shouldn't it use <symbol>@ticker instead? to connect to a single market stream (the one we pass in param for example)

Binance doc: https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams

karimhossenbux commented 3 years ago

fixed this in #280 👀

bmancini55 commented 3 years ago

Released in https://github.com/altangent/ccxws/releases/tag/v0.44.0

Thanks!

karimhossenbux commented 3 years ago

Awesome, thank you for merging @bmancini55 🙏