coinbasepro-python
coinbasepro-python copied to clipboard
Websocket empty?
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?
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.
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...
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 :)
Appreciate your sharing that. Sharing with my co-contributor: @theimo1221
Are you still seeing this @pmaji ?
Yes @mcardillo55 -- off of master @ https://github.com/pmaji/crypto-whale-watching-app
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.