Implements the trigger strategy using the official Hyperliquid Python SDK.
- Start/stop time in IST
- Single-session reference price P computed once at start
- Buy at P + buffer% or Sell at P - buffer%
- Stop loss and take profit (percent of entry). Bot fully stops on TP.
- Leverage and position sizing (e.g., 2% of equity)
- Cumulative max loss stop
- Limit orders with repricing every 2 seconds by 0.05%
- Testnet/mainnet toggle via config
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtCreate a .env file next to bot.py:
HL_ACCOUNT_ADDRESS=your_pub_key_here
HL_SECRET_KEY=your_priv_key_hereThe bot loads these automatically and ignores credentials in config.yaml.
Edit config.yaml for session, risk, strategy, execution:
session.testnet: truefor Hyperliquid Testnet;falsefor Mainnet- URLs come from SDK:
constants.TESTNET_API_URLandconstants.MAINNET_API_URL
python bot.py # uses ./config.yaml and ./.env
# or
python bot.py /abs/path/to/config.yamlsession:
start_time_ist: "19:00"
stop_time_ist: "23:00"
instrument: "BTC"
testnet: true- For production, add explicit order status polling and idempotent cancel/replace.
- Test on testnet first with very small sizing.