Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyperliquid recreates reversing order on close #6948

Open
tijsk opened this issue Apr 3, 2024 · 6 comments
Open

Hyperliquid recreates reversing order on close #6948

tijsk opened this issue Apr 3, 2024 · 6 comments

Comments

@tijsk
Copy link

tijsk commented Apr 3, 2024

Describe the bug

When an order is closed (long or short) a new open is made in the opposite direction.
Occurs in Source and Docker installation, see attached logfile.

For more info send me a message on Discord, I'd like to help.

Steps to reproduce

  1. Tried different scripts, for example; perpetual_market_making, but also v2_generic_with_controllers
  2. 1 or multiple coins active doesn't matter
  3. Let the script run and let the script finish a trade
  4. See an order appear after a few seconds after close of initial order

Release version

1.26

Type of installation

Docker and Source

Attach required files

message.txt

Conf script

markets: {}
candles_config: []
controllers_config:

  • conf_directional_trading.dman_v3_SOL.yml
    config_update_interval: 20
    script_file_name: v2_generic_with_controllers.py

Conf controller

id: 3tfTznFJZwMPmXj9kCQvdrnChdsjpbsPDif9idf6WheJ
controller_name: dman_v3
controller_type: directional_trading
manual_kill_switch: null
candles_config: []
connector_name: hyperliquid_perpetual
trading_pair: SOL-USD
executor_amount_quote: 3000.0
max_executors_per_side: 1
cooldown_time: 15
leverage: 20
position_mode: ONEWAY
stop_loss: 0.25
take_profit: 0.005
time_limit: null
take_profit_order_type: 2
trailing_stop:
activation_price: 0.004
trailing_delta: 0.001
candles_connector: binance_perpetual
candles_trading_pair: SOL-USDT
interval: 5m
bb_length: 100
bb_std: 2.0
bb_long_threshold: 0.2
bb_short_threshold: 0.8
dca_spreads:

  • 0.005
  • 0.006
  • 0.008
  • 0.01
  • 0.013
    dca_amounts_pct:
  • 1
  • 1.01
  • 1.02
  • 1.03
  • 1.04
  • 1.05
    dynamic_order_spread: true
    dynamic_target: false
    activation_bounds: null
@tijsk tijsk added the bug label Apr 3, 2024
@ghost
Copy link

ghost commented Apr 28, 2024

I've ran into something similar. I closed the positions created by hummingbot via exchange front-end and then noticed that orders in the opposite direction with equal size and leverage were created.

I was also using dman_v3, as I was following the hyperliquid vault tutorial.

@nikspz
Copy link
Contributor

nikspz commented Apr 29, 2024

Describe the bug

When an order is closed (long or short) a new open is made in the opposite direction. Occurs in Source and Docker installation, see attached logfile.

Reproduced on latest development (during the longrun with ~same config)

logs_conf_v2_generic_with_controllers_hpl1.log

issue6948hpl.zip

image

HPL longrun has issue with wrong position side (CLOSE on bot and OPEN on exchange)  This leads to increasing position amount

After stop command bot failed to close position:
HPL after stop command - failed to close
image

@nikspz nikspz added the P2 label May 1, 2024
@nikspz
Copy link
Contributor

nikspz commented May 3, 2024

Bounty: fix the issue with inconsistent position side / order creation
Sponsor: HB Foundation
Bounty amount: 50K HBOT or 160 USDC
Developer portion: 50K HBOT or 160 USDC

@yancong001
Copy link
Contributor

yancong001 commented May 6, 2024

hi,nikspz @nikspz
This is the fix I submitted
#7013

@yancong001
Copy link
Contributor

can test whether there is any problem. If there is any problem, I will continue to repair it

@nikspz
Copy link
Contributor

nikspz commented May 16, 2024

fixed, fix merged to latest development (dev-1.28.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Merged
Development

No branches or pull requests

4 participants