[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1469":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":16,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":19,"hasPages":19,"topics":21,"createdAt":10,"pushedAt":10,"updatedAt":42,"readmeContent":43,"aiSummary":44,"trendingCount":16,"starSnapshotCount":16,"syncStatus":45,"lastSyncTime":46,"discoverSource":47},1469,"hyperliquid-trading-bot","NoFxAi-OS\u002Fhyperliquid-trading-bot","NoFxAi-OS","hyperliquid grid trading bot dex perpetuals l1 crypto typescript nodejs automated algorithmic grid-strategy testnet wallet orderbook risk stop-loss drawdown rebalance python defi hft open-source trading-strategy spot leverage ohlcv rest-api crypto-bot quant scalp dca maker taker","https:\u002F\u002Fgithub.com\u002FNoFxAi-OS\u002Fhyperliquid-trading-bot",null,"Python",197,183,213,1,0,6.79,"Apache License 2.0",false,"main",[22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41],"algorithmic-trading","automated-trading","bitcoin","blockchain","crypto-bot","cryptocurrency","defi","dex","ethereum","grid-trading","hyperliquid","l1","nodejs","open-source","perpetuals","quantitative-trading","testnet","trading-bot","trading-strategy","typescript","2026-06-12 02:00:28","# Hyperliquid grid trading bot\n\n**Repository:** [github.com\u002FNoFxAi-OS\u002Fhyperliquid-trading-bot](https:\u002F\u002Fgithub.com\u002FNoFxAi-OS\u002Fhyperliquid-trading-bot)\n\nA configurable grid strategy runner for [Hyperliquid](https:\u002F\u002Fhyperliquid.xyz). It places layered buy and sell orders around a price range and supports basic risk rules (stop loss, take profit, drawdown limits, and rebalancing). The main implementation is **TypeScript on Node.js**; a legacy **Python** tree remains for reference and scripts.\n\n> **Risk.** Trading digital assets and derivatives is risky. This repository is for education and research. You can lose your capital. **Use Hyperliquid testnet and small size until you understand the behavior.** The authors and contributors are not providing financial or legal advice.\n\n---\n\n## What you need\n\n| Requirement | Notes |\n|-------------|--------|\n| [Node.js](https:\u002F\u002Fnodejs.org\u002F) **20.19 or newer** | Required for the main bot (`package.json` → `engines`). |\n| A Hyperliquid **wallet (private key)** | For testnet: use a dedicated key; fund via [testnet faucet](https:\u002F\u002Ffaucet.chainstack.com\u002Fhyperliquid-testnet-faucet) or your preferred source. |\n| `git` | To clone the repository. |\n\nOptional: [uv](https:\u002F\u002Fgithub.com\u002Fastral-sh\u002Fuv) if you use the Python examples under `learning_examples\u002F` or `src\u002Frun_bot.py`.\n\n---\n\n## Install and run (main bot)\n\nFollow these steps in order.\n\n**1. Clone and install dependencies**\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FNoFxAi-OS\u002Fhyperliquid-trading-bot.git\ncd hyperliquid-trading-bot\nnpm install\n```\n\n**2. Environment file**\n\n```bash\ncp .env.example .env\n```\n\nEdit `.env` and set at least:\n\n- **Testnet:** `HYPERLIQUID_TESTNET_PRIVATE_KEY`, `HYPERLIQUID_TESTNET=true`, and the testnet URL variables if you use the defaults from `.env.example`.\n- **Mainnet (real funds):** use the mainnet private key variable and `HYPERLIQUID_TESTNET=false` as described in `.env.example`. **Double-check YAML `exchange.testnet: false` for live trading.**\n\nNever commit `.env` or share your private key.\n\n**3. Bot configuration**\n\nConfigs live in `bots\u002F*.yaml`. The sample `btc_conservative.yaml` is a conservative grid profile. Set `active: true` on the file you want the auto-discovery runner to pick (only one should be `active: true` if you rely on auto-discovery), or pass an explicit path when starting (see below).\n\n**4. Validate, then start**\n\n```bash\nnpm run validate\nnpm start\n```\n\n| Command | Purpose |\n|--------|---------|\n| `npm start` | Runs the bot using the first `active: true` config under `bots\u002F`. |\n| `npm run validate` | Checks that a selected YAML is structurally valid (no private key required for this step). |\n| `npx tsx ts\u002Fsrc\u002FrunBot.ts path\u002Fto\u002Fconfig.yaml` | Runs with an explicit config file. |\n| `npm test` | Runs automated tests (e.g. grid math). |\n\nOn **Ctrl+C**, the engine attempts to cancel open orders; review logs for your environment.\n\n---\n\n## How configuration fits together\n\n- **`.env`** – Private keys, testnet flag, and API base URLs. See `.env.example` for all options and comments.\n- **`bots\u002F\u003Cname>.yaml`** – Strategy name, `exchange` (e.g. Hyperliquid, testnet on\u002Foff), `account` allocation, `grid` (symbol, levels, range), `risk_management`, and `monitoring.log_level`.\n\nThe TypeScript runner reads YAML and can override `exchange.testnet` with `HYPERLIQUID_TESTNET` in `.env` when set.\n\nExample structure (illustrative; see `bots\u002Fbtc_conservative.yaml` for the full, commented file):\n\n```yaml\nname: \"my_grid\"\nactive: true\n\nexchange:\n  type: \"hyperliquid\"\n  testnet: true\n\naccount:\n  max_allocation_pct: 10.0\n\ngrid:\n  symbol: \"BTC\"\n  levels: 10\n  price_range:\n    mode: \"auto\"\n    auto:\n      range_pct: 5.0\n\nrisk_management:\n  stop_loss_enabled: false\n  take_profit_enabled: false\n  max_drawdown_pct: 15.0\n  max_position_size_pct: 40.0\n  rebalance:\n    price_move_threshold_pct: 12.0\n\nmonitoring:\n  log_level: \"INFO\"\n```\n\n---\n\n## Risk features (overview)\n\nWhen enabled in YAML, the stack can act on things like: stop loss, take profit, maximum drawdown, position size limits, and grid rebalancing when price moves outside your band. Defaults are conservative in spirit; read each flag in the sample bot file before enabling live trading.\n\n---\n\n## Python (legacy) and learning examples\n\nThe `src\u002F` tree and `src\u002Frun_bot.py` are the older Python entrypoint. To use them:\n\n```bash\nuv sync\nuv run src\u002Frun_bot.py --validate\nuv run src\u002Frun_bot.py\n```\n\nEducational scripts (market data, orders, websockets) live under `learning_examples\u002F`. Examples:\n\n```bash\nuv run learning_examples\u002F01_websockets\u002Frealtime_prices.py\nuv run learning_examples\u002F02_market_data\u002Fget_all_prices.py\nuv run learning_examples\u002F04_trading\u002Fplace_limit_order.py\n```\n\nUse testnet keys and small sizes when experimenting.\n\n---\n\n## Development\n\n- **TypeScript:** `npx tsc --noEmit` for typecheck; `npm test` for tests. Layout and commands: [ts\u002FREADME.md](ts\u002FREADME.md).\n- **Python:** `uv run …` as above; see `AGENTS.md` \u002F `CLAUDE.md` for repository conventions if you contribute.\n\n### Publishing to `NoFxAi-OS` (maintainers)\n\nTo create or update the GitHub org repository under **NoFxAi-OS**, set metadata (description, [Hyperliquid](https:\u002F\u002Fhyperliquid.xyz) homepage, topics), and push `main`, you can use `scripts\u002Fpublish-to-polypulse.ps1` as a template or push manually. You need a [personal access token](https:\u002F\u002Fgithub.com\u002Fsettings\u002Ftokens) with permission to create repositories in the org. **Do not** commit tokens. In PowerShell, set `GITHUB_TOKEN` for the current session only, then run the script from the repository root. Revoke any token that was exposed (e.g. in chat or logs).\n\n---\n\n## License and disclaimer\n\nThis software is provided “as is,” without warranty of any kind. You are solely responsible for how you use it, for securing keys and API access, and for compliance with applicable laws and exchange rules in your jurisdiction.\n","Hyperliquid grid trading bot 是一个用于执行网格交易策略的自动化交易机器人，专为Hyperliquid平台设计。项目主要使用TypeScript和Node.js开发，同时也保留了部分Python脚本作为参考。其核心功能包括自动放置买卖订单、支持基本的风险管理规则如止损、止盈、回撤限制及再平衡等。适合对数字货币进行量化交易、算法交易的研究者或有一定经验的交易员在测试网环境中使用，以熟悉其行为后再考虑小规模实盘操作。本项目遵循Apache License 2.0开源协议，旨在教育与研究目的，不提供任何形式的财务或法律建议。",2,"2026-05-06 17:33:04","CREATED_QUERY"]