pmaji / crypto-whale-watching-app

Python Dash app that tracks whale activity in cryptocurrency markets.
MIT License
609 stars 137 forks source link

App doesn't work any more #115

Closed mifunetoshiro closed 3 years ago

mifunetoshiro commented 3 years ago

Doesn't plot any graph, doesn't load any data.

Error here:

  File "C:\Python\lib\threading.py", line 916, in _bootstrap_inner
    self.run()
  File "C:\Python\lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Python\lib\site-packages\cbpro\websocket_client.py", line 41, in _go
    self._listen()
  File "C:\Python\lib\site-packages\cbpro\websocket_client.py", line 91, in _listen
    self.on_message(msg)
  File "C:\test\gdax_book.py", line 21, in on_message
    sequence = message['sequence']
KeyError: 'sequence'

And doesn't load any data:

2020-11-25 10:45:59.950112 [Errors]: Empty data for GDAXETH-EUR Will wait 3s
2020-11-25 10:46:00.125238 [Errors]: Empty data for GDAXETH-BTC Will wait 3s
2020-11-25 10:46:00.412958 [Errors]: Empty data for GDAXBTC-USD Will wait 3s

Edit: I see this is also mentioned in bugs #112 and #113

I tested both on Windows and Linux, same issue. Maybe related to https://github.com/danpaquin/coinbasepro-python/issues/365 ?

mifunetoshiro commented 3 years ago

Fixed it by changing https://github.com/pmaji/crypto-whale-watching-app/blob/master/gdax_book.py#L12 to: super(GDaxBook, self).__init__(url="wss://ws-feed.pro.coinbase.com", products=[self.product], channels=["ticker"])

and https://github.com/pmaji/crypto-whale-watching-app/blob/master/gdax_book.py#L21 to: sequence = message.get('sequence', -1)

Not going to close & pull a request because I don't know if this is a legitimate fix or just a dirty workaround, but it works!

pmaji commented 3 years ago

This did fix it! Thanks for this @mifunetoshiro ; excellent find! I'm updating master post test shortly.