hitbtc-com / hitbtc-api

HitBTC API
GNU Lesser General Public License v3.0
322 stars 153 forks source link

Subscribe to multiple pairs on websocket. #197

Closed aspramsh closed 5 years ago

aspramsh commented 5 years ago

Hi all from @hitbtc-com ,

I want to subscribe simultaneously to multiple pairs to get trades on Hitbtc websocket. Is it possible with one JSON request?

icehongssii commented 5 years ago

I try to subscribe every pair in hitbtc sending 880 requests(...!!!) but I got 429(too many requests error). Anyone solved this problem? I would like to know as well

aspramsh commented 5 years ago

This is exactly my case.

icehongssii commented 5 years ago

@aspramsh or..Do you know anyway to send delay requests to the server by websockets?

aspramsh commented 5 years ago

@icehongssii no, I am waiting for someone to answer here.

kz0 commented 5 years ago

@hitbtc-com how is this realtime data when it's impossible to subscribe without getting 429 even with a 1 second delay?

hitbtc-com commented 5 years ago

see example https://gist.github.com/hitbtc-com/fc738c1b926d9d7aa7e3bd5247f792a1 you should subscribe once

ilaurensnl commented 5 years ago

see example https://gist.github.com/hitbtc-com/fc738c1b926d9d7aa7e3bd5247f792a1 you should subscribe once

You mean with for (let s of subscribeSymbols) { logger.info('Subscribe to orderbook', s.id); await socketApi.request('subscribeOrderbook', {symbol: s.id}); } ?

It still does requests one by one instead of a single multi-subscribe. as what was requested. I don't mind either way but looks to me that it's just a waste of resources. Odd that they make a javascript version like that, it's asking to get mass-pinged.

Xemed-PGordon commented 3 years ago

I'm left wondering where to re-open this issue to ask HitBTC to add support for this to its API.