[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-76292":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":14,"stars30d":15,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":16,"rankGlobal":9,"rankLanguage":9,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":9,"pushedAt":9,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":14,"starSnapshotCount":14,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},76292,"hyperliquid-trading-bot","fristork\u002Fhyperliquid-trading-bot","fristork","hyperliquid trading bot hyperliquid bot hyperliquid copytrading bot hyperliquid trading bot hyperliquid bot hyperliquid copytrading bot hyperliquid trading bot hyperliquid bot hyperliquid copytrading bot hyperliquid trading bot hyperliquid bot hyperliquid copytrading bot hyperliquid trading bot hyperliquid bot hyperliquid copytrading bot",null,"TypeScript",151,2764,100,0,50,55,"Apache License 2.0",false,"main",true,[22,23,24,25],"bot","hyperliquid","hyperliquid-dex","trading","2026-06-11 04:06:42","# Hyperliquid grid trading bot\n\nA **Node.js (TypeScript)** grid trading bot for [Hyperliquid](https:\u002F\u002Fhyperliquid.xyz): configurable grid levels, WebSocket mid prices, limit orders via the official API stack, and risk rules (drawdown, position size, optional stop \u002F take profit).\n\n> **Node.js ≥ 20.19** is required (used by `@nktkas\u002Fhyperliquid`).\n\n## Features\n\n- **Grid strategy** — geometric price levels, buy below \u002F sell above mid, optional rebalance when price drifts\n- **Hyperliquid** — `Info` + `Exchange` clients, testnet or mainnet\n- **Risk** — max drawdown, max position as % of account, optional stop-loss and take-profit\n- **Config** — YAML files under `bots\u002F` (same style as before), `active: true` for auto-pick\n- **Keys** — env vars, optional per-bot fields in YAML (not recommended for production)\n\n## Quick start\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Ffristork\u002Fhyperliquid-trading-bot.git\nnpm install\ncp .env.example .env   # if you add an example; otherwise create .env (see below)\n```\n\nSet your private key (testnet is strongly recommended first):\n\n| Environment | Purpose |\n|-------------|---------|\n| `HYPERLIQUID_TESTNET_PRIVATE_KEY` | `0x…` key (use Hyperliquid [testnet](https:\u002F\u002Fapp.hyperliquid-testnet.xyz) for development) |\n| `HYPERLIQUID_MAINNET_PRIVATE_KEY` | mainnet (real funds) |\n| `HYPERLIQUID_PRIVATE_KEY` | legacy fallback for both |\n| `HYPERLIQUID_TESTNET` | `true` \u002F `false` (default follows `exchange.testnet` in YAML) |\n\nValidate configuration:\n\n```bash\nnpm run validate\n# or\nnpx tsx src\u002FrunBot.ts --validate bots\u002Fbtc_conservative.yaml\n```\n\nRun the bot (picks the first `active: true` file in `bots\u002F`, or pass a path):\n\n```bash\nnpm start\nnpx tsx src\u002FrunBot.ts bots\u002Fbtc_conservative.yaml\n```\n\nStop with `Ctrl+C` (open orders are cancelled; positions are left unchanged).\n\n## Configuration (`bots\u002F*.yaml`)\n\nKey sections:\n\n- **`active`** — `true` so this file is auto-selected when you don’t pass a path  \n- **`exchange.type`** — `hyperliquid` or `hl`  \n- **`exchange.testnet`** — `true` for `https:\u002F\u002Fapi.hyperliquid-testnet.xyz`  \n- **`account.max_allocation_pct`** — share of a notional `10_000` USD base used to size `total_allocation` in the engine (see `src\u002FrunBot.ts`)  \n- **`grid`** — `symbol`, `levels`, `price_range.auto.range_pct`  \n- **`risk_management`** — drawdown, position caps, `rebalance.price_move_threshold_pct` for the grid, optional SL\u002FTP  \n- **`monitoring.log_level`** — `DEBUG` \\| `INFO` \\| `WARNING` \\| `ERROR`\n\nEdit the sample file: `bots\u002Fbtc_conservative.yaml`.\n\n## Project layout\n\n```\nbots\u002F                    # Bot YAML configs\nsrc\u002F\n  runBot.ts              # CLI: validate, run, discover active config\n  core\u002F                  # Engine, config loader, keys, risk\n  exchanges\u002F             # Hyperliquid adapter + WebSocket market data\n  strategies\u002Fgrid\u002F      # Basic grid strategy\n  interfaces\u002F            # Exchange + strategy types\n```\n\n## Scripts\n\n| Command | Description |\n|---------|-------------|\n| `npm start` | Run the bot |\n| `npm run validate` | Load and validate YAML (uses first active `bots\u002F*.yaml` if no path) |\n| `npm run typecheck` | `tsc --noEmit` |\n\n## Stack\n\n- **[@nktkas\u002Fhyperliquid](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@nktkas\u002Fhyperliquid)** — Info \u002F Exchange \u002F transport  \n- **[viem](https:\u002F\u002Fviem.sh)** — wallet from private key  \n- **[ws](https:\u002F\u002Fgithub.com\u002Fwebsockets\u002Fws)** — `allMids` subscription  \n- **[js-yaml](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fjs-yaml)** — configs  \n- **[pino](https:\u002F\u002Fgetpino.io\u002F)** — structured logs  \n\n## Safety\n\n- Never commit a real private key. Use env vars or a file outside the repo.  \n- Test on **testnet** and small size before mainnet.  \n- This software is for automation **at your own risk**; the authors are not responsible for trading losses.\n\n","这是一个基于Node.js（TypeScript）的Hyperliquid交易所网格交易机器人，支持配置网格级别、WebSocket中间价、通过官方API堆栈下的限价单以及风险管理规则（如回撤、仓位大小、可选止损\u002F止盈）。项目采用几何价格层级策略，在价格低于或高于中间价时进行买卖操作，并在价格漂移时可选择重新平衡。适用于需要自动化执行网格交易策略的场景，尤其是在对风险控制有严格要求的情况下。使用YAML文件配置参数，易于管理和调整。",2,"2026-05-19 02:31:40","CREATED_QUERY"]