sammchardy / python-binance

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

limit parameter is ignored on start_futures_depth_socket #1257

Open yarimiz opened 1 year ago

yarimiz commented 1 year ago

Describe the bug When creating a ThreadedDepthCacheManager and starting a future depth socket (start_futures_depth_socket), the limit parameter is not being passed deep enough. So the subscription message to Binance uses the default "10" value.

This isn't happening if starting a spot depth socket.

To Reproduce symbol = 'BTCUSDT'

dcm = ThreadedDepthCacheManager(api_key=api_key, api_secret=api_secret)
dcm.start()

def handle_dcm_message(depth_cache):
    print("Hi GitHub")

dcm.start_futures_depth_socket(callback=handle_dcm_message, symbol=symbol, limit=20)

dcm.join()

Expected behavior The limit parameter should be taken in consideration when subscription to futures book updates.

Environment (please complete the following information):