coinbasepro-python icon indicating copy to clipboard operation
coinbasepro-python copied to clipboard

Websocket empty?

Open pmaji opened this issue 5 years ago • 7 comments

Hey all,

We use your package (ever since GDAX) as part of this whale watching app. Recently, we noticed that the websockets were just coming back empty. Is this something you're aware of?

pmaji avatar Apr 14 '19 13:04 pmaji

what feed are you using? I've been using the 'matches' feed and have had no lapse in data. Be aware that there was recently an issue with bitcoin and the bitcoin market was halted for a few hours. When this happens there are no trades and the feed is empty. I do resubscribe often because the feed drops out quite regularly, then you are sure to get the next trade when it happens.

noah222 avatar Apr 14 '19 17:04 noah222

I don't know exactly what 'matches' feed means in this case, but I think we're using the same data. We're only using cases where the message is matched. You can see the small snippet of code that I'm referring to here.

It is doing better today, so maybe it was partially the btc problem you mentioned, but it appears that I am needing to resubscribe far more often than I was a few months ago...

pmaji avatar Apr 14 '19 20:04 pmaji

I use my own script for managing a connection to the feed data, and the subscription message is:

message = { "type": "subscribe", "channels": [{"name": "matches", "product_ids": ["ETH-USD"]}] }

I resubscribe every minute or after several message time outs, just in case. It feels totally redundant but not missing data is worth it, especially when in the middle of trades. The only time I missed data in the last month was when my power went out :)

noah222 avatar Apr 14 '19 21:04 noah222

Appreciate your sharing that. Sharing with my co-contributor: @theimo1221

pmaji avatar Apr 14 '19 21:04 pmaji

Are you still seeing this @pmaji ?

mcardillo55 avatar Nov 22 '20 11:11 mcardillo55

Yes @mcardillo55 -- off of master @ https://github.com/pmaji/crypto-whale-watching-app

pmaji avatar Nov 22 '20 21:11 pmaji

Are you trying to get the code in gdax_book.py to work? And which version of cbpro are you using?

I recommend using the version from git (trying to get it updated on PyPi, but you can pip install git+https://github.com/danpaquin/coinbasepro-python.git for now)

WebsocketClient now requires channels. See https://github.com/danpaquin/coinbasepro-python/commit/646e99bbb1e883e47cbbbb8d1d8096a8f467c1aa for the changes you'll need to make to get gdax_book.py working again. I'm not sure if this is directly the root of the issue, but seems like a good place to start.

mcardillo55 avatar Nov 23 '20 00:11 mcardillo55