hummingbot / hummingbot

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

HEDGE STRATEGY GATE.IO PERP BUG - HEDGE VALUE ALWAYS 0 #6470

Closed Drtikol22 closed 1 year ago

Drtikol22 commented 1 year ago

Describe the bug

There is a bug in the hedge strategy v 1.17 gate.io connector. When in value mode and HEDGE position mode the bot is not seeing the position on gate perp. The trade to do the hedge is calculated and performed correctly, but "status" shows position 0 and hedge value 0 after the trade is made. So the bot is thinking that the position is not hedged and performing the same trade again and again..

I also tested it with binance futures testnet and worked with no problems, so it looks its only gate.io specific problem.

Snímek obrazovky 2023-07-11 v 9 49 27

Steps to reproduce

  1. create hedge strategy spot gate.io - gate perp, value mode
  2. gate.io spot pair - BUSD-USDT, gate.io perp pair - PENDLE-USDT.
  3. Busd amount on spot 10, PENDLE amount on perp 0
  4. when strategy start, it will hedge the amount of BUSD by creating a short postition of 12 PENDLE. So now the position is hedged correctly
  5. after hedge_interval the bot performs another sell of 12 PENDLE so now creating a disbalance. Shorted position is bigger than spot position
  6. bot continuos shorting 12 PENDLE every hedge_interval until stopped manually

Release version

1.17.0

Type of installation

Docker

Attach required files

For some reason I cant find a log and config file containing this instance :/

leastchaos commented 1 year ago

Hi, this is related to the connector. From what your screenshot shows, the hedge strategy cannot detect opened position. From my side, it also cannot detect open positions in gate_io_perpetual. I also tried using another strategy "perpetual market making" and it also cannot detect position in gate_io_perpetual connector. @cardosofede are you able to help to check if the gate_io_perp account positions is working? image

rapcmia commented 1 year ago

The fix on gateio perpetual hedge has been added to development and will be available on release version 1.20.0