question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to watch balance on spot

See original GitHub issue
  • OS: Windows
  • Programming Language version: Python 3.9
  • CCXT version: 1.40.26
  • CCXT PRO version: 0.5.26
https://github.com/ccxt/ccxt/blob/master/examples/ccxt.pro/py/binance-watch-margin-balance.py

Executing this example, but watching balance on spot, not on margin

  1. launch the example with MY keys and keep it running
  2. go to the SPOT trading on the website
  3. place a market order on a spot market
  4. see your balance updated in the example

Result: Balance not updated.

2021-01-11T11:15:36.388Z connecting to wss://stream.binance.com:9443/ws/BNDg6cIFtDMKasxTiIu7t3pRCG0fsi3j00G3kpOalxcU1GM6aj0bukR5KrsO with timeout 10000 ms                                                     
2021-01-11T11:15:37.356Z connected                                                                                                                                                                             
2021-01-11T11:15:37.357Z ping loop                                                                                                                                                                             
2021-01-11T11:15:37.662Z pong WSMessage(type=<WSMsgType.PONG: 10>, data=bytearray(b''), extra='')                                                                                                              
2021-01-11T11:16:07.642Z pong WSMessage(type=<WSMsgType.PONG: 10>, data=bytearray(b''), extra='')                                                                                                              
2021-01-11T11:16:13.729Z ping WSMessage(type=<WSMsgType.PING: 9>, data=bytearray(b'1610363773980'), extra='')                                                                                                  
2021-01-11T11:16:30.408Z message {"e":"executionReport","E":1610363790658,"s":"BNBBTC","c":"electron_4b20287581f14fe1960df91f9f0","S":"SELL","o":"MARKET","f":"GTC","q":"0.10000000","p":"0.00000000","P":"0.00000000","F":"0.00000000","g":-1,"C":"","x":"NEW","X":"NEW","r":"NONE","i":662048052,"l":"0.00000000","z":"0.00000000","L":"0.00000000","n":"0","N":null,"T":1610363790654,"t":-1,"I":1418202459,"w":true,"m":false,"M":false,"O":1610363790654,"Z":"0.00000000","Y":"0.00000000","Q":"0.00000000"}                                                                                                                            
2021-01-11T11:16:30.409Z message {"e":"executionReport","E":1610363790658,"s":"BNBBTC","c":"electron_4b20287581f14fe1960df91f9f0","S":"SELL","o":"MARKET","f":"GTC","q":"0.10000000","p":"0.00000000","P":"0.00000000","F":"0.00000000","g":-1,"C":"","x":"TRADE","X":"FILLED","r":"NONE","i":662048052,"l":"0.10000000","z":"0.10000000","L":"0.00112600","n":"0.00007336","N":"BNB","T":1610363790654,"t":99695960,"I":1418202460,"w":false,"m":false,"M":true,"O":1610363790654,"Z":"0.00011260","Y":"0.00011260","Q":"0.00000000"}                                                                                                       
2021-01-11T11:16:30.411Z message {"e":"outboundAccountPosition","E":1610363790658,"u":1610363790654,"B":[{"a":"BTC","f":"0.00580812","l":"0.00000000"},{"a":"BNB","f":"0.78655788","l":"0.00000000"}]}         
2021-01-11T11:16:37.671Z pong WSMessage(type=<WSMsgType.PONG: 10>, data=bytearray(b''), extra='')                                                                                                              
2021-01-11T11:17:07.791Z pong WSMessage(type=<WSMsgType.PONG: 10>, data=bytearray(b''), extra='')     

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
igorpuchkovcomcommented, Jan 11, 2021
Exception in callback FastClient.receive_loop.<locals>.handler() at /home/ubuntu/.local/lib/python3.8/site-packages/ccxtpro/base/fast_client.py:20
handle: <Handle FastClient.receive_loop.<locals>.handler() at /home/ubuntu/.local/lib/python3.8/site-packages/ccxtpro/base/fast_client.py:20>
Traceback (most recent call last):
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/ccxtpro/base/fast_client.py", line 25, in handler
    self.handle_message(message)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/ccxtpro/base/aiohttp_client.py", line 32, in handle_message
    self.handle_text_or_binary_message(message.data)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/ccxtpro/base/aiohttp_client.py", line 27, in handle_text_or_binary_message
    self.on_message_callback(self, decoded)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/ccxtpro/bittrex.py", line 711, in handle_message
    self.handle_subscription_status(client, message)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/ccxtpro/bittrex.py", line 625, in handle_subscription_status
    subscriptionsById = self.index_by(client.subscriptions, 'id')
  File "/home/ubuntu/.local/lib/python3.8/site-packages/ccxt/base/exchange.py", line 858, in index_by
    if ((is_int_key and (key < len(element))) or (key in element)) and (element[key] is not None):
RuntimeError: await wasn't used with future
1reaction
frosty00commented, Jan 11, 2021

will test this code on my end

Read more comments on GitHub >

github_iconTop Results From Across the Web

Diagnosing Complex Watch Problems - The Balance - YouTube
Your browser can't play this video. Learn more. Switch camera.
Read more >
Balance problems: Symptoms, diagnosis, and treatment
People who experience trouble with balance and coordinating their movements should see a doctor if symptoms persist.
Read more >
Why Having Bad Balance Is Something You Shouldn't Ignore
Vertigo that causes imbalance can be a sign of a stroke—if it's sudden and paired with other stroke symptoms like numbness, weakness, speech ......
Read more >
Balance assembly advice for a clumsy amateur watch enthusiast
Then when putting the balance wheel and make sure the roller jewel/impulse pin is pointed towards the center wheel not towards the pallet...
Read more >
Visual Guide to Balance Disorders - WebMD
It's not a fear of heights, though lots of people think it is. It's not even a "disorder," really. Vertigo is a symptom...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found