[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-78383":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":14,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":15,"rankGlobal":9,"rankLanguage":9,"license":16,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":17,"topics":20,"createdAt":9,"pushedAt":9,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":14,"starSnapshotCount":14,"syncStatus":28,"lastSyncTime":29,"discoverSource":30},78383,"hyperliquid-trading-bot","LucaRatiu\u002Fhyperliquid-trading-bot","LucaRatiu","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",130,1929,136,0,9.86,"Apache License 2.0",false,"main",true,[21,22,23,24],"bot","hyperliquid","hyperliquid-dex","trading","2026-06-12 02:03:47","# 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\u002FLucaRatiu\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止盈设置。适用于需要自动化执行网格交易策略的场景，特别是在加密货币市场中追求稳定收益的用户。其配置灵活，允许用户根据个人需求调整参数，同时提供了详细的启动和配置指南，便于快速上手。",2,"2026-05-24 02:30:08","CREATED_QUERY"]