Skip to content

jordan-max-dev/hyperliquid-grid-trading-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hyperliquid Grid Bot

TypeScript starter for an adaptive Hyperliquid perpetual grid trading bot with:

  • Dry-run mode by default
  • Live execution gated behind env config
  • Volatility-aware grid spacing
  • Position caps, drawdown guard, leverage guard, and dead-man switch
  • Historical candle backtest for parameter tuning

Important

This bot is not guaranteed to be profitable. Grid strategies usually perform best in range-bound markets and can get hurt badly in strong trends, volatility expansions, and low-liquidity conditions. Keep LIVE_TRADING=false until you have tuned and observed behavior on your own account.

Quick Start

npm install
copy .env.example .env
npm run backtest

To run the live loop in dry-run mode:

npm run dev

Live Trading

  1. Fill in .env
  2. Set ACCOUNT_ADDRESS for read-only account tracking, or set PRIVATE_KEY to derive it automatically
  3. Keep IS_TESTNET=true while validating behavior
  4. Switch LIVE_TRADING=true only after you are satisfied with logs and backtest behavior

Core Parameters

  • HYPERLIQUID_SYMBOL: perp symbol, for example ETH
  • GRID_LEVELS: number of buy and sell levels
  • ORDER_SIZE_USD: notional per grid order
  • GRID_SPACING_PCT_MIN / GRID_SPACING_PCT_MAX: bounds on spacing
  • GRID_SPACING_VOL_MULT: scales spacing with volatility
  • MAX_POSITION_USD: cap on long or short directional exposure
  • MAX_DRAWDOWN_PCT: halt condition based on starting equity
  • MAX_VOLATILITY_PCT: halt condition for unstable market regimes

Commands

npm run dev
npm run backtest
npm run build
npm run typecheck

Notes

  • Live orders are posted as Alo limit orders.
  • Managed live orders use deterministic client order IDs, so the bot can reconcile its own grid.
  • The backtest is intentionally simple: it does not model fees, funding, latency, or intrabar path accurately.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages