Skip to content

Adeshh/Hyperliquid-bot-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hyperliquid Trigger Bot (Python)

Implements the trigger strategy using the official Hyperliquid Python SDK.

Features

  • 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

Install

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Credentials via .env

Create a .env file next to bot.py:

HL_ACCOUNT_ADDRESS=your_pub_key_here
HL_SECRET_KEY=your_priv_key_here

The bot loads these automatically and ignores credentials in config.yaml.

Configure

Edit config.yaml for session, risk, strategy, execution:

  • session.testnet: true for Hyperliquid Testnet; false for Mainnet
  • URLs come from SDK: constants.TESTNET_API_URL and constants.MAINNET_API_URL

Run

python bot.py              # uses ./config.yaml and ./.env
# or
python bot.py /abs/path/to/config.yaml

Example: enable Testnet

session:
  start_time_ist: "19:00"
  stop_time_ist: "23:00"
  instrument: "BTC"
  testnet: true

Notes

  • For production, add explicit order status polling and idempotent cancel/replace.
  • Test on testnet first with very small sizing.

About

This is an automated bot which trades on given parameters.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages