CoinAlpha / hummingbot

Hummingbot is open source software that helps you build trading bots that run on any exchange or blockchain
https://www.hummingbot.org
Apache License 2.0
172 stars 84 forks source link

Failed Test PR #330 - Unhandled error in background task #336

Closed rxlxrxsx closed 1 year ago

rxlxrxsx commented 1 year ago

Summary and Screenshots

There are instances that this error appears after an order is created. Despite the error I didn't any impact on the bot's performance.

Screen Shot 2023-04-05 at 1 20 51 PM
2023-04-05 13:40:34,318 - 6023 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: No update found for order BIJUT5f89bf6fdedc5553cd431bad176207b0a0962697eeeeb
Traceback (most recent call last):
  File "/Users/reiniersalazar/hbot-ca-injperp/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
    return await c
  File "/Users/reiniersalazar/hbot-ca-injperp/hummingbot/connector/gateway/clob_perp/data_sources/injective_perpetual/injective_perpetual_api_data_source.py", line 241, in get_order_status_update
    raise ValueError(f"No update found for order {in_flight_order.client_order_id}")
ValueError: No update found for order BIJUT5f89bf6fdedc5553cd431bad176207b0a0962697eeeeb

Steps To Reproduce

  1. Clone and install featured branch
  2. Connect to gateway
  3. Create and run a perpetual market making strategy
  4. Monitor the log pane

Expected Results

No error should appear during the bot's run time

Test Result Comparison

N/A, new connector

Attachments

Logs and config: inj_perp.zip

petioptrv commented 1 year ago

This is to be expected. Same deal as with Dexalot and Injective spot. Since it takes a bit of time for the order to be added to the block chain, it's possible that a order status check happens in between when the order is sent and the order is created (the order exists in the bot, but not yet on the chain). When that happens, it's normal that the order status cannot be retrieved. The key is that at the end of the run there are no orphan orders on the exchange, and that all trading is properly captured and recorded by the bot.