LUCIT-Systems-and-Development / unicorn-binance-websocket-api

A Python SDK by LUCIT to use the Binance Websocket API`s (com+testnet, com-margin+testnet, com-isolated_margin+testnet, com-futures+testnet, com-coin_futures, us, tr, dex/chain+testnet) in a simple, fast, flexible, robust and fully-featured way.
https://unicorn-binance-websocket-api.docs.lucit.tech/
Other
684 stars 165 forks source link

COINM Futures AggTrade doesnt work #208

Closed Indiana3714 closed 2 years ago

Indiana3714 commented 2 years ago

Check this or we will delete your issue. (fill in the checkbox with an X like so: [x])

Select one:

Environment

What kind of internet connection do you have?

Fiber

Average system load (CPU)

Include here the ammount of cpu cores and the average system load.

Hardware specification

Include here a description of the server hardware.

Operating System? (include version)

Options

Which endpoint do you connect?

binance.com-coin-futures

Python Version Requirement

Exact Python Version?

3.9.7

Pip Version?

pip21.3

Dependencies

Run pip list > pip_list.txt and upload the file.

UNICORN Binance WebSocket API Version?

Did you upgrade to the latest release version with `pip install unicorn-binance-websocket-api --upgrade`?

Please control what version you are using with this script and post the output: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/blob/master/tools/get_used_module_version.py

Description of your issue

[example_binance_coin_futures.py.log](https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/files/7364338/example_binance_coin_futures.py.log)

After cloning your master branch yesterday, I've used your example "example_binance_coin_futures.py" and commented out lines 64 to 74 and 79 to 83. (This leaves aggTrade being the only channel subscribed)

Here's the summary after 1 minute, (no packets are ever received):


==================== unicorn-binance-websocket-api_1.34.1.dev-python_3.9.7 ====================
 exchange: binance.com-coin-futures
 uptime: 1m:1s since 2021-10-18, 11:12:24 UTC
 streams: 1
 active_streams: 1
 subscriptions: 3
 current_receiving_speed: 0 B/s
 average_receiving_speed: 0.0 B/s (per day 0.0 gB)
 highest_receiving_speed: 0 B/s (reached at 2021-10-18, 11:12:24 UTC)
 total_receives: 0
 total_received_bytes: 0 (0 B)
 total_transmitted_payloads: 1
 stream_buffer_maxlen: None
 process_ressource_usage: cpu=11.2%, memory=47.76 mB, threads=6
 ---------------------------------------------------------------------------------------------
               stream_id              |   stream_label  |  last  |  average  |  peak  | recon
 ---------------------------------------------------------------------------------------------
 5ca08a9a-5fec-4ff1-a05e-6b4b0e927e40 | None            |      0 |       0.0 |      0 |      0
 ---------------------------------------------------------------------------------------------
 all_streams                                            |      0 |       0.0 |      0 |      0
===============================================================================================```
oliver-zehentleitner commented 2 years ago

Maybe CoinM Futures are affected by this bug too: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/issues/196

just try installing websockets 9.1 instead of 10.0 and start it again! Does it work now?

Indiana3714 commented 2 years ago

Yes it works fine with websockets 9.1

Perhaps thats why python-binance restricted it to 9.1 as well in one of their latest releases, here is the log after changing to websockets 9.1 if it helps you:

example_binance_coin_futures.py.log

Summary:

==================== unicorn-binance-websocket-api_1.34.1.dev-python_3.9.7 ====================
 exchange: binance.com-coin-futures
 uptime: 1m:4s since 2021-10-18, 12:54:42 UTC
 streams: 1
 active_streams: 1
 subscriptions: 3
 current_receiving_speed: 6.63 kB/s
 average_receiving_speed: 24.62 kB/s (per day 2.03 gB)
 highest_receiving_speed: 200.8 kB/s (reached at 2021-10-18, 12:55:10 UTC)
 total_receives: 6942
 total_received_bytes: 1627176 (1.55 mB)
 total_transmitted_payloads: 1
 stream_buffer_maxlen: None
 process_ressource_usage: cpu=22.6%, memory=48.04 mB, threads=6
 ---------------------------------------------------------------------------------------------
               stream_id              |   stream_label  |  last  |  average  |  peak  | recon
 ---------------------------------------------------------------------------------------------
 b3180eb8-8fc9-4c59-9790-2de45c937f80 | None            |     29 |    108.09 |    878 |      0
 ---------------------------------------------------------------------------------------------
 all_streams                                            |     29 |    108.09 |    878 |      0
===============================================================================================
oliver-zehentleitner commented 2 years ago

for sure it is, i know the issue on python-binance.

we are doing the same. i think till ubwa 1.33.1 we used websockets 9.1 and i swapped to websockets 10.0 with 1.34.0. then we recognized this bug, reported it to websocket libs and they found out an issue in binance and AWS api gateway and they reported it to AWS and i reported it to binance. binance confirmed the issue and is planing to release an update on their futures api in the end of october 2021. then the new "optimization feature" (which is provocation this bug) will be supported by binance and we can use it. till then i disabled the new feature of websockets 10.0 in ubwa for future endpoints. i will release 1.34.2 soon with a fix for coin-futures and websockets 10.0.

oliver-zehentleitner commented 2 years ago

https://pypi.org/project/unicorn-binance-websocket-api/1.34.2/

Indiana3714 commented 2 years ago

I see thanks Oliver, any chance you can edit the requirements and setup.py for websockets==9.1? That way poetry can resolve correctly on your main branch