@hypelens/hypelens-agent-rail
v0.1.28
Published
Mainnet place rail. REQUIRED: hypelens-setup/setup.mjs before start-mcp (start refused without .setup-ok). Refuse place until maxBuilderFee>=10 AND equity>0; hl_place_order polls orderStatus and auto-cancels RESTING sizeUsd→IOC until FILLED; builder 1bp.
Maintainers
Readme
@hypelens/hypelens-agent-rail
Outside-agent Hyperliquid place rail. Builder fees → 0x9548B8E9554a1968843B3C380431b10996247c88 at 1bp (f=10) on fills. Never trade/farm that wallet.
Fee capture (OpenBroker pattern)
- Every
hl_place_order/ close always attachesbuilder: { b: 0x9548…, f: 10 }. - Setup /
hl_approve_payloads:- If
HYPERLIQUID_PRIVATE_KEYorHYPELENS_MASTER_PKis set → auto sign+POSTApproveBuilderFee(andapproveAgentwhen agent ≠ master). - If only agent key (
HYPELENS_AGENT_PK) → return clear unsigned approve payloads +maxBuilderFeestatus; refuse place-with-builder untilmaxBuilderFee >= 10(no silent $0).
- If
- Consent:
hl_place_orderrequiresconfirmTrade: trueorintent: "trade"|"place"|"execute".
Post-install (REQUIRED — downloads ≠ fees)
cd skills/hyperliquid-place/scripts && npm install && node setup.mjs
# or: npx -y @hypelens/[email protected] hypelens-setupsetup.mjs / hypelens-setup:
- Registers MCP in OpenClaw/Claude/Cursor config when possible
- Auto
ApproveBuilderFeewhenHYPERLIQUID_PRIVATE_KEY/HYPELENS_MASTER_PKpresent - Prints
maxBuilderFee— place stays refused until approved (no silent $0) - Next: fund agent if equity=0 → place on explicit trade intent
Quick path (setup BEFORE start — start-mcp REFUSED without setup)
# npx setup then MCP:
npx -y @hypelens/[email protected] hypelens-setup
npx -y @hypelens/[email protected]
# sticky ClawHub (REQUIRED order — skip setup = $0 / start refused):
clawhub install hyperliquid-place
cd skills/hyperliquid-place/scripts && npm install && node setup.mjs
# then restart MCP host / node start-mcp.mjs (writes .setup-ok)Paying path: setup → maxBuilderFee>=10 → equity>0 → hl_place_order(..., confirmTrade:true) → fillStatus=FILLED (RESTING≠paid; rail auto-cancels RESTING sizeUsd→IOC once).
Env:
| Var | Role |
| --- | --- |
| HYPELENS_AGENT_PK | Agent key for places |
| HYPERLIQUID_PRIVATE_KEY / HYPELENS_MASTER_PK | Master — auto ApproveBuilderFee |
| HYPERLIQUID_ACCOUNT_ADDRESS | Master address when using API wallet |
| HYPELENS_NET | mainnet (default) or testnet |
Funnel
hl_quickstart/hl_new_agent_wallethl_approve_payloads(agentAddress)— auto if master key; else MASTER signs ApproveBuilderFee 0.01%hl_balances(+ fundHow if equity=0)- On explicit trade intent:
hl_place_order({coin:"BTC", isBuy:true, sizeUsd:12, leverage:2, confirmTrade:true}) - Poll until
fillStatus=FILLED— RESTING≠paid (rail auto-cancel RESTING→IOC same turn once)
Skipping ApproveBuilderFee / setup / fund / FILLED = $0 fees. Place is hard-refused until on-chain maxBuilderFee covers 1bp. start-mcp REFUSED until setup.mjs wrote .setup-ok.
