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 #315 - Failed to fetch trade updates when restarting a strategy using Injective #319

Closed rxlxrxsx closed 1 year ago

rxlxrxsx commented 1 year ago

Summary and Screenshots

Getting this error when restarting a strategy using Injective.

Screen Shot 2023-03-13 at 11 08 55 AM
2023-03-13 11:08:24,058 - 12105 - hummingbot.connector.gateway.clob_spot.gateway_clob_spot.GatewayCLOBSPOT - WARNING - Failed to fetch trade updates for order BIJUT5f6cb240a8068d6e3f2509794b922eaf289e249424ddd. Error: cannot convert float NaN to integer
Traceback (most recent call last):
  File "/Users/reiniersalazar/hbot-ca-dexalot/hummingbot/connector/exchange_py_base.py", line 975, in _update_orders_fills
    trade_updates = await self._all_trade_updates_for_order(order=order)
  File "/Users/reiniersalazar/hbot-ca-dexalot/hummingbot/connector/gateway/clob_spot/gateway_clob_spot.py", line 590, in _all_trade_updates_for_order
    trade_updates = await self._api_data_source.get_all_order_fills(in_flight_order=order)
  File "/Users/reiniersalazar/hbot-ca-dexalot/hummingbot/connector/gateway/clob_spot/data_sources/injective/injective_api_data_source.py", line 449, in get_all_order_fills
    updated_at=int(in_flight_order.last_update_timestamp * 1e3)
ValueError: cannot convert float NaN to integer
2023-03-13 11:08:24,068 - 12105 - hummingbot.connector.gateway.clob_spot.gateway_clob_spot.GatewayCLOBSPOT - WARNING - Failed to fetch trade updates for order SIJUT5f6cb240a90b1d6e3f2509794b922eaf289e249424ddd. Error: cannot convert float NaN to integer
Traceback (most recent call last):
  File "/Users/reiniersalazar/hbot-ca-dexalot/hummingbot/connector/exchange_py_base.py", line 975, in _update_orders_fills
    trade_updates = await self._all_trade_updates_for_order(order=order)
  File "/Users/reiniersalazar/hbot-ca-dexalot/hummingbot/connector/gateway/clob_spot/gateway_clob_spot.py", line 590, in _all_trade_updates_for_order
    trade_updates = await self._api_data_source.get_all_order_fills(in_flight_order=order)
  File "/Users/reiniersalazar/hbot-ca-dexalot/hummingbot/connector/gateway/clob_spot/data_sources/injective/injective_api_data_source.py", line 449, in get_all_order_fills
    updated_at=int(in_flight_order.last_update_timestamp * 1e3)
ValueError: cannot convert float NaN to integer

Steps To Reproduce

  1. Clone and install branch
  2. Setup and run gateway using the feature PR for Dexalot
  3. Connect Injective wallet
  4. Create and run a pure MM strategy using Injective
  5. Run for a couple minutes or let the bot create and cancel orders then restart the strategy

Test Result Comparison

I tried replicating this on the foundation repository however I encountered an issue which further blocks testing.

Attachments

Logs and config: inective_315.zip

petioptrv commented 1 year ago

This is an existing issue. I have addressed it on the Injective batch orders PR and merged the changes into this PR. This should be fixed now.

rxlxrxsx commented 1 year ago

Still getting this issue on the latest commit 0f46fb7 using the steps provided above.

Screen Shot 2023-03-14 at 9 42 25 AM
2023-03-14 09:41:41,039 - 3973 - hummingbot.connector.gateway.clob_spot.gateway_clob_spot.GatewayCLOBSPOT - WARNING - Failed to fetch trade updates for order BIJUT5f6de0e61a94de6bad9b4bb8f5c241eee85bfb0f87040. Error: cannot convert float NaN to integer
Traceback (most recent call last):
  File "/Users/reiniersalazar/hbot-ca-dexalot/hummingbot/connector/exchange_py_base.py", line 976, in _update_orders_fills
    trade_updates = await self._all_trade_updates_for_order(order=order)
  File "/Users/reiniersalazar/hbot-ca-dexalot/hummingbot/connector/gateway/clob_spot/gateway_clob_spot.py", line 590, in _all_trade_updates_for_order
    trade_updates = await self._api_data_source.get_all_order_fills(in_flight_order=order)
  File "/Users/reiniersalazar/hbot-ca-dexalot/hummingbot/connector/gateway/clob_spot/data_sources/injective/injective_api_data_source.py", line 449, in get_all_order_fills
    updated_at=int(in_flight_order.last_update_timestamp * 1e3)
ValueError: cannot convert float NaN to integer

Logs and config: injective.zip

petioptrv commented 1 year ago

This should be now fixed with the merger of the upstream injective changes: 4e5f70e

rxlxrxsx commented 1 year ago

Tested on commit cf2023c and confirmed fixed.