Hyperliquid Trading Bot Rust
Hyperliquid Tranding (Perp trading) Bot Rust: Automated trading bot, compatible with Hyperliquid DEX
Install / Use
npx skills add 0xTan1319/hyperliquid-trading-bot-rustInstalls into whichever agent you are using.
README
Hyperliquid Trading (perp trading) Bot - Rust
Hyperliquid trading(Perp trading) Bot with Rust is an experimental trading system built with
hyperliquid_rust_sdk. It manages multiple
markets on the Hyperliquid exchange and places trades based on signals from
user-selected indicators.
The repository currently ships a React/TS UI and actix server, follow the getting started steps.
Contact
If you have any question or need more update for this, contact here: Telegram | Twitter
Features
- Connect to Hyperliquid mainnet, testnet or localhost.
- Manage several markets concurrently with configurable margin allocation.
- Customisable strategy (risk, style, stance).
- Indicator engine where each indicator is bound to a timeframe.
- Asynchronous design using
tokioandflumechannels.
Getting started
After cloning the repo
-
Install a recent Rust toolchain.
-
Create a
.envfile in the root directory`:PRIVATE_KEY=<your API private key> -> https://app.hyperliquid.xyz/API AGENT_KEY=<optional agent api public key> WALLET=<public wallet address> -
Run the app:
./run.sh
Strategy
The bot uses CustomStrategy (see src/strategy.rs). It combines indicators
such as RSI, StochRSI, EMA crosses, ADX and ATR. Risk level (Low, Normal,
High), trading style (Scalp or Swing) and market stance (Bull, Bear or
Neutral) can be set. Signals are generated when multiple indicator conditions
agree—for example an oversold RSI with a bullish StochRSI crossover may trigger a
long trade.
Indicators
Indicators are activated with (IndicatorKind, TimeFrame) pairs. Available kinds
include:
Rsi(u32)SmaOnRsi { periods, smoothing_length }StochRsi { periods, k_smoothing, d_smoothing }Adx { periods, di_length }Atr(u32)Ema(u32)EmaCross { short, long }Sma(u32)
Each pair is wrapped in an Entry together with an EditType (Add, Remove or
Toggle). The snippet below (from enginetest.rs) shows how a market can be
created with a custom indicator configuration:
let config = vec![
(IndicatorKind::Rsi(12), TimeFrame::Min1),
(IndicatorKind::EmaCross { short: 21, long: 200 }, TimeFrame::Day1),
];
let market = AddMarketInfo {
asset: "BTC".to_string(),
margin_alloc: MarginAllocation::Alloc(0.1),
trade_params,
config: Some(config),
};
Project structure
src/bot.rs– orchestrates markets and keeps margin in sync.src/market.rs– handles a single market: data feed, signal engine and order execution.src/signal/– indicator trackers and strategy logic.src/executor.rs– sends orders via the Hyperliquid API.- 'src/strategy.ra' - Implements strategies followed by the signal engine.
src/trade_setup.rs– trading parameters and trade metadata.config.toml– example strategy configuration.
Supported trading pairs can be found in src/assets.rs (MARKETS).
Disclaimer
This code is experimental and not audited. Use at your own risk when trading on live markets.
Related Skills
clawhub
385.5kSearch ClawHub for skills when a requested capability is not already available; install, verify, update, uninstall, publish, or sync skills.
coding-agent
385.5kDelegate coding work to Codex, Claude Code, or OpenCode as background workers; not simple edits or read-only code lookup.
node-connect
385.5kDiagnose OpenClaw Android, iOS, or macOS node pairing, QR/setup code, route, auth, and connection failures.
taskflow
385.5kCoordinate multi-step detached tasks as one durable TaskFlow job with owner context, state, waits, and child tasks.
