hummingbot / hummingbot

Open source software that helps you create and deploy high-frequency crypto trading bots
https://hummingbot.org
Apache License 2.0
7.94k stars 2.76k forks source link

Client - fast order refresh and stopping bot causes failed to cancel order #5758

Closed arnelhbot closed 1 year ago

arnelhbot commented 1 year ago

Describe the bug Upon testing on Dev1.9.0 with Cross exchange market making strategy set for passive order refresh with certified connectors for both maker and taker, It was observed that a Failed to cancel the following orders on (certified connector): would happen when there are orders created and the bot is stopped.

Tested with: Binance, Kucoin, Ascendex, Gateio, FTX, Bybit, Okx, Hitbtc, Huobi

Note: This seems to be a display issue since there were no actual stuck orders on the exchanges.

Traceback (most recent call last):
  File "/home/ubuntu/Hummingbot/pull_request/development/hummingbot/connector/exchange_py_base.py", line 523, in _execute_order_cancel
    cancelled = await self._place_cancel(order.client_order_id, order)
  File "/home/ubuntu/Hummingbot/pull_request/development/hummingbot/connector/exchange/kucoin/kucoin_exchange.py", line 214, in _place_cancel
    if tracked_order.exchange_order_id in cancel_result["data"].get("cancelledOrderIds", []):
KeyError: 'data'

Steps To Reproduce Here are the steps to reproduce the issue (see attachments in the section below):

  1. Clone latest Dev v1.9.0
  2. Start Client and create password
  3. Connect API Keys
  4. Create cross_exchange_market_making strategy
  5. Set Kucoin as maker or taker
  6. Set to passive order refresh
  7. Set min_profitabilty to -1 to trigger order fills
  8. Start Bot and wait for order creations
  9. Stop bot when you see order fills for both sides

...

Screenshots image image

image

Release version Dev1.9.0

Attachments XEMM_logs.zip

nikspz commented 1 year ago

This also happened for pureMM strategy with order refresh time 1 and order_refresh_tolerance on the previous versions image

currently can't reproduce

rapcmia commented 1 year ago

We are not able to reproduce this issue on the latest development branch. Closing ticket for now, else we can reopen if issue occurs again/ Thank you