sammchardy / python-binance

Binance Exchange API python implementation for automated trading
https://python-binance.readthedocs.io/en/latest/
MIT License
6.11k stars 2.22k forks source link

Something wrong in the "start_futures_multiplex_socket"? #871

Open yiluzhou opened 3 years ago

yiluzhou commented 3 years ago

Dear author,

I'm trying to use the websocket for market data. The "start_multiplex_socket" is working properly, and I can pull the market data. But the "start_futures_multiplex_socket" doesn't work.

The socket_name in the source function "start_futures_multiplex_socket" (Line 1226 in streams.py, see pasted below) should be "futures_multiplex_socket", instead of the "options_multiplex_socket"?

Update: after I changed to "futures_multiplex_socket", the "start_futures_multiplex_socket" is working now.

def start_futures_multiplex_socket(
    self, callback: Callable, streams: List[str], futures_type: FuturesType = FuturesType.USD_M
) -> str:
    return self._start_async_socket(
        callback=callback,
        socket_name='options_multiplex_socket',
        params={
            'streams': streams,
            'futures_type': futures_type
        }
    )
sebadlf commented 3 years ago

Hi, I have exactly the same problem and I ended up using the same workaround.

Please let me know if a PR might be useful

Regards

sammchardy commented 3 years ago

Will resolve in next update

sammchardy commented 3 years ago

This has been fixed in v1.0.11

yiluzhou commented 3 years ago

Great! Thank you very much!