Hyperliquid生态AI自动交易中枢
简介
Hyperliquid生态一站式链上操作中心,整合BlockBeats市场情报与DEX交易,支持AI自主交易,需严格保护私钥与API密钥
原始描述
Integrated on-chain operations hub: integrates BlockBeats market intelligence, Hyperliquid DEX trading via `hl1m`, wallet creation and management at https://...
通过你的 Agent 添加
安装目录:1m-trade-dex/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
综合评估
1m-trade 是一个面向 Hyperliquid 生态系统的链上操作枢纽,通过编排多个子技能实现"感知-决策-执行"闭环。核心能力分为四大模块:
核心用法
- 市场情报 (
1m-trade-news):调用 BlockBeats Pro API 获取实时加密市场情绪、ETF资金流向、宏观指标(M2、DXY)及链上交易数据 - 钱包管理:浏览器端在 1m-trade.com 创建账户,CLI 端通过
hl1m init-wallet绑定(仅使用代理私钥,禁用主钱包私钥) - 交易执行 (
1m-trade-dex):支持市价/限价单、持仓查询、K线分析,覆盖 BTC/ETH/SOL 及股票/商品合成资产(GOLD、NVDA 等) - 自主交易模式:通过
openclaw cron设置定时任务,AI 每 20 分钟自动执行"扫描新闻→分析K线→风控决策→下单"全闭环
显著优点
- 生态整合度高:单入口打通情报、钱包、交易三大环节,无需切换平台
- 自动化能力强:支持完全无人值守的 AI 交易策略,风控规则明确(单仓位名义价值>15 USDC)
- 安全设计分层:强制区分主私钥与代理私钥,CLI 操作仅需代理密钥,降低密钥暴露面
- 多资产覆盖:除主流币外支持股票、大宗商品、外汇的合成资产交易
潜在局限与风险
- 私钥管理风险:尽管强制使用代理私钥,但用户若误操作粘贴主私钥至聊天,或本地
.env文件被窃取,仍可能导致资金损失 - API 依赖:BlockBeats 与 Hyperliquid 服务中断将直接影响情报与交易执行
- 自主交易黑箱:AI 决策过程缺乏人工审核环节,极端行情下可能触发非预期交易
- 配置复杂度:需正确设置
BLOCKBEATS_API_KEY、HYPERLIQUID_PRIVATE_KEY_ENC等多组环境变量,新手易出错 - 智能合约风险:Hyperliquid 作为相对中心化的 DEX,存在合约漏洞与治理风险
适合人群
- 已熟悉 Hyperliquid 生态、追求自动化交易效率的进阶 DeFi 用户
- 需要整合市场情报与快速执行的交易型用户
- 不适合私钥管理新手、无法接受AI自主决策的资金管理者
常规风险提示
- 绝对禁止:在聊天中粘贴任何私钥(包括代理私钥);LLM 被明确禁止读取或回显
.env内容 - 建议操作:代理私钥仅通过本地 CLI
hl1m init-wallet输入,定期轮换 API 密钥 - 资金控制:自主交易模式建议设置小额测试仓位,确认策略稳定性后再扩大规模
技能正文
name: 1m-trade-dex
description: |
Hyperliquid DEX/Perps entrypoint via hl1m: market queries, order placement. Wallet creation/management at https://www.1m-trade.com; local hl1m init-wallet with address + proxy (API) private key — never the main wallet key. No in-skill private-key messaging.
requires:
bins: [hl1m]
install:
- pipx install 1m-trade metadata: openclaw: emoji: "🚀" os: [darwin, linux, win32] tags: [crypto, news, trading, hyperliquid, wallet, dex, automation]
Setup
1. Install CLI
which hl1m
If hl1m is missing, install the 1m-trade package (requires Python 3.11+ and pipx):
- If
pipxexists:pipx install 1m-trade - If
pipxis missing:- Linux: install
pipxviaapt/yum/dnf - macOS:
brew install pipx - Windows:
python -m pip install --user pipxthenpython -m pipx ensurepath
- Linux: install
pipx install 1m-trade
2. Verify
hl1m --help
3. Upgrade
pipx upgrade 1m-trade
Basic syntax
hl1m [--testnet] <command> [command_args]
Core flags
--testnet: use Hyperliquid testnet (default: mainnet)
Wallet initialization
Official wallet UI (create & manage):
- For creating a wallet and managing it (addresses, keys, proxy/API settings as offered by the product), direct users to 1M-Trade in the browser. Do not recreate that flow inside chat.
- After the user has what they need from the site, they can bind the CLI locally with
init-walletbelow.
When to trigger: user wants to use their own wallet with this skill (e.g. “init wallet”, “connect my wallet”, “configure Hyperliquid”, first-time setup before trading).
Natural-language binding (one-shot address + proxy key)
Use this when the user asks to configure/bind the trading account and supplies both a wallet address and a proxy (API) private key in the same message (often with explicit field labels).
Recognized intents (examples, non-exhaustive):
configure trading account,bind wallet,init wallet,set up the CLI,connect Hyperliquid, with fields labeled likewallet addressandproxy private key/API private key/proxy key.- If the user writes in another language, map phrases that clearly denote public wallet address vs proxy/API signing key to
--addressand--pri_keyrespectively (same semantics as the English labels above).
Label → flag mapping:
| User wording (meaning) | hl1m flag |
|---|---|
wallet address, address, or any label clearly referring to the public trading / master address shown in the UI |
--address |
proxy private key, API private key, proxy key, or any label clearly referring to the bot/API signing key — not the main EOA key |
--pri_key |
Parsing (apply before running init-wallet):
- Extract address: first
0x+ 40 hexadecimal characters (case-insensitive), typically the value next to a label for the public wallet / address when labels exist. - Extract proxy key: first
0x+ 64 hexadecimal characters (typical for this flow). If the user wrote 64 hex digits without0x, prefix0xwhen the CLI requires it (seehl1m --help). - Require both values; if only one is present, do not guess — ask for the missing piece or point to 1M-Trade + show the placeholder command only.
- If multiple
0x…strings appear, use labels to pair: the hex labeled as address →--address; the hex labeled as proxy/API key →--pri_key. Do not swap.
Exact command (values come from the user message; run in a trusted local shell):
hl1m init-wallet --address <parsed_address> --pri_key <parsed_proxy_private_key>
Assistant output: confirm bind success or CLI error; run hl1m query-user-state after success. Do not repeat the full private key in chat (mask or omit).
What to use (recommended):
--address: your wallet public address on Hyperliquid (the address you trade / view balances with — often the same as the “master” address shown in the UI, even when using a proxy key for signing).--pri_key: the proxy private key (API / agent / delegated signing key) that Hyperliquid or your setup provides for automated trading — not the key that controls the full wallet.
Critical security warning:
- Never initialize with your wallet’s main / master private key (the EOA root key that fully controls funds). If that key is ever leaked from this CLI, local disk, or chat, you can lose the entire wallet.
- Use only the proxy private key intended for bots/APIs, plus the correct public address pairing. If you are unsure which key is which, stop and confirm in your wallet or Hyperliquid docs before running
init-wallet.
Rules:
- Do not ask users to paste secrets unless they are already initiating bind; prefer they run
init-walletlocally with no keys in chat. If they already sent address + proxy key in one message for binding, parse per Natural-language binding above, invokehl1m init-wallet, and do not echo full keys in replies. - You only execute
hl1mcommands; do not edit skill files or read.envcontents into the model context.
Command (placeholders — user substitutes on their machine; never paste real keys in chat):
hl1m init-wallet --address 0xYourWalletAddress --pri_key 0xYourProxyPrivateKey
--address: wallet public address (see above).--pri_key: proxy private key for signing — not the main wallet private key.
If your CLI supports key-only init, you may use --pri_key alone when the address is derived from the key; follow hl1m --help / reference.md for your version.
After success:
- Run
hl1m query-user-stateto confirm the account is visible and balances look correct.
Constraints
- If the user cannot open a position (e.g., insufficient margin), do not close other positions unless the user explicitly requests it.
Command list
Note: for any asset name (e.g. --coin), you can run query-meta to confirm the exact symbol. For example, user input "gold" often maps to xyz:GOLD. Always pass the canonical symbol.
1) Query commands
| Command | Description | Example |
|---|---|---|
query-user-state |
Query user state (positions + balances). Optional address override; structure follows the API/SDK response. | hl1m query-user-state --address 0x123... |
query-open-orders |
Query open orders | hl1m --testnet query-open-orders |
query-fills |
Query fills / trade history | hl1m query-fills |
query-meta |
Query asset metadata (all symbols) | hl1m query-meta |
query-mids |
Query mid prices (all symbols) | hl1m query-mids |
query-kline |
Query kline/candles for a symbol | hl1m query-kline --coin BTC --period 15m --start 1772511125000 --end 1772597525000 |
Retry rule (query commands only):
- If a query command returns an empty result (null/None, empty string, empty list/array, empty object/dict, or no meaningful fields), retry the same command exactly once.
- Do not change any args/flags/symbols/time ranges/formatting between the first attempt and the retry.
- If the second attempt is still empty, stop retrying and report: the command you ran, that it returned empty twice, and a brief possible cause (no data, endpoint delay, wrong symbol, no account activity).
Query command arguments
query-user-state
--address: optional. If omitted, the address is derived from the configured private key.
query-kline
--coin: required. Symbol such asBTC,ETH, orxyz:TSLA. Usequery-metato confirm the canonical symbol first.--period: required. One of:1m,3m,5m,15m,30m,1h,2h,4h,8h,12h,1d,3d,1w,1M.--start: optional (ms). Default is the start of the last 24 hours.--end: optional (ms). Default is the current timestamp in ms.
2) Trading commands
| Command | Description | Example |
|---|---|---|
place-order |
Place a limit order (HIP-3 supported) | hl1m place-order --coin BTC --is-buy True --qty 0.01 --limit-px 50000 --tif Gtc |
market-order |
Place a market order (recommended for HIP-3) | hl1m --testnet market-order --coin ETH --is-buy True --qty 0.1 --slippage 0.01 |
market-close |
Close a position with a market order (recommended for HIP-3) | hl1m market-close --coin ETH --qty 0.1 --slippage 0.01 |
cancel-order |
Cancel orders | hl1m cancel-order --oid 123456 --coin HYPE |
update-leverage |
Update leverage | hl1m update-leverage --coin BTC --leverage 10 --is-cross True |
update-isolated-margin |
Transfer isolated margin (HIP-3) | hl1m update-isolated-margin --coin xyz:GOLD --amount 10 |
Trading command arguments
General rules
- For
--coin, always resolve the canonical symbol (usequery-metaif needed). - For
--qty, usequery-metaresults (e.g.szDecimals) to format the quantity precision correctly.
update-isolated-margin
--coin: required. Canonical symbol.--amount: required. Transfer amount.
place-order
--coin: required.--is-buy: required (True/False). True = long, False = short.--qty: required.--limit-px: required.--tif: optional (Gtc/Ioc/Alo, defaultGtc).--reduce-only: optional (default False).
market-order
--coin: required.--is-buy: required (True/False). True = long, False = short.--qty: required.--slippage: optional (default 0.02 = 2%).
market-close
--coin: required.--qty: required.--slippage: optional (default 0.02 = 2%).
cancel-order
--coin: optional; cancel all orders for a given symbol--oid: optional; cancel a specific order id- If neither is provided, cancel all open orders.
update-leverage
--coin: required.--leverage: required (integer).--is-cross: optional (True/False, default True).
Output
All commands print formatted JSON for easy parsing:
- Query commands: full data for the requested dimension
- Trading commands: results for order submit/cancel/leverage updates (success flags, order IDs, etc.)
Error handling
- Network issues: handled by the SDK with error messages
- Invalid trading parameters: returns official Hyperliquid error responses
Notes
- Private keys are sensitive. Do not expose or share them.
- Testnet vs mainnet are strictly separated. Confirm
--testnetbefore acting. - Adjust slippage for market orders based on volatility; too small may fail.
- Leverage trading is risky. Choose leverage carefully.
- For proxy-style setups, follow
hl1mhelp for--address/--pri_keybehavior.
Summary
- Use
hl1mfor queries, trading, andinit-walletto bind a user-supplied address and key to local encrypted state. - Install via
pipx install 1m-trade(or your package manager); seehl1m --helpandreference.mdfor full flags.
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。