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
168 stars 81 forks source link

Failed Test PR #330 - Trades performed outside the bot are being captured #339

Closed rxlxrxsx closed 1 year ago

rxlxrxsx commented 1 year ago

Summary and Screenshots

Trades are being captured by the bot that were performed manually in the exchange. In this scenario I manually closed a position in the web app and after restarting the bot it captured the trade several times.

Screen Shot 2023-04-06 at 12 35 57 PM Screen Shot 2023-04-06 at 12 50 42 PM Screen Shot 2023-04-06 at 12 50 58 PM

Steps To Reproduce

  1. Clone and install featured branch
  2. Connect to gateway
  3. Create a perpetual market making strategy using Injective Perpetual
  4. Manually execute a trade in the web app, either by opening or closing a position
  5. Start the strategy and observe that it will record the trades performed outside the bot

Test Result Comparison

N/A, new connector

Attachments

Logs and config: inj_filled.zip

petioptrv commented 1 year ago

I am not able to reproduce this locally. I did push a fix for a bug I caught while investigating this, but I am not sure it will directly address the issue. However, in the logs I see that the order order has a hummingbot order ID associated with it, so it's linking it to an order from the previous session. When trying to test this further, please keep the logs from the previous session. Also, please include the db and csv files along with them. Those will help in chasing down this particular issue.

rxlxrxsx commented 1 year ago

Tested on commit 43f25d6 and still getting the issue.

Screen Shot 2023-04-07 at 3 10 46 PM

Logs, config and data: inj_339.zip

petioptrv commented 1 year ago

Thank you for the logs. I was able to pinpoint the issue. I've added a fix in this commit.

mrhzysbl commented 1 year ago

Tested and confirmed in commit c3e51d1 that it no longer captures trades performed on the exchange