Hyperliquid API Reference for Openclaw

A compact, desk-ready Hyperliquid API reference for safely reading market data, signing trading actions, handling WebSockets, and diagnosing API errors.

galleonlabs
v1.0.0
Aug 17, 2026
0
139
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install hypergrok-hyperliquid-api-reference

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install hypergrok-hyperliquid-api-reference using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Hyperliquid API Reference?

The Hyperliquid API Reference is a verified technical guide for developers and AI agents integrating with Hyperliquid perpetuals, spot markets, HIP-3 deployments, HIP-4 outcomes, and HyperEVM. It consolidates REST endpoints, WebSocket subscriptions, request and response envelopes, asset identifiers, tick and lot rules, rate limits, order states, signing schemes, and official documentation links.

As part of Openclaw Skills, this reference helps an agent look up exact fields, request types, limits, signing requirements, and error causes before generating or reviewing a Hyperliquid API call. It distinguishes API-wallet actions from main-wallet actions so automation can remain within the desk's authorization boundaries.

Hyperliquid API Reference Use Cases

  • Build or review Hyperliquid REST integrations using the /info and /exchange endpoints.
  • Query order books, candles, trades, funding, account state, fills, fees, portfolio history, and rate limits.
  • Generate valid perp, spot, HIP-3, and HIP-4 asset identifiers without hardcoding environment-specific indexes.
  • Validate price precision, size rounding, minimum order value, reduce-only behavior, trigger orders, and margin constraints.
  • Implement API-wallet trading flows for orders, cancellations, leverage, isolated margin, scheduled cancellation, and TWAP orders.
  • Diagnose rejected orders, invalid signatures, insufficient margin, tick-size violations, liquidity failures, and other documented error strings.
  • Add WebSocket market-data, account-state, order-update, and user-event streaming to trading systems.
  • Prepare testnet integrations while accounting for separate endpoints, chain IDs, asset IDs, and tighter margin tiers.
  • Give AI coding agents a precise Hyperliquid integration reference through Openclaw Skills.

How Hyperliquid API Reference Works

  1. Identify the required environment and transport: mainnet or testnet REST, WebSocket, and HyperEVM RPC endpoints.
  2. Select the appropriate unsigned /info request or signed /exchange action and construct its documented payload envelope.
  3. Resolve live metadata before trading, including universe indexes, spot token details, decimals, leverage limits, margin tiers, and active asset data.
  4. Normalize values using Hyperliquid rules: lowercase addresses, string-formatted numeric values, valid nonces, price precision, size decimals, minimum notional, and valid client order IDs.
  5. Determine the authorization model. L1 actions can use an API wallet, while user-signed transfers, approvals, and account-level actions require the main wallet and may be outside desk automation.
  6. Sign eligible actions using the documented msgpack, keccak, EIP-712 Agent, or HyperliquidSignTransaction flow, including nonce, source, chain, vault, and expiration data as applicable.
  7. Submit the request over REST or WebSocket and interpret the response status, order result, cancellation result, or error string rather than relying only on HTTP status.
  8. Monitor asynchronous state through orderStatus, account queries, WebSocket subscriptions, fills, ledger updates, and heartbeat handling.
  9. Apply rate-limit and pagination rules to batch historical reads safely, using the last returned timestamp for time-ranged continuation.
  10. Consult the linked official Hyperliquid documentation when a niche request type, newly introduced action, or ambiguous field requires confirmation.

Hyperliquid API Reference Setup

No package installation is required: this skill is a compact API reference used by an AI coding agent or developer during Hyperliquid integration work.

  1. Add the skill to the agent's skills directory according to the host Openclaw Skills installation process.
  2. Use the official documentation root and fetch raw Markdown by appending .md to a documentation URL when current details need verification.
  3. Configure the correct environment endpoints:
export HYPERLIQUID_REST_URL=https://api.hyperliquid.xyz
export HYPERLIQUID_WS_URL=wss://api.hyperliquid.xyz/ws
export HYPERLIQUID_EVM_RPC_URL=https://rpc.hyperliquid.xyz/evm

For testnet, use https://api.hyperliquid-testnet.xyz, wss://api.hyperliquid-testnet.xyz/ws, and https://rpc.hyperliquid-testnet.xyz/evm with chain 998 instead of mainnet chain 999.

  1. Set the JSON content type for REST requests:
curl -X POST "$HYPERLIQUID_REST_URL/info" \
  -H "Content-Type: application/json" \
  -d '{"type":"allMids"}'
  1. Load live metadata with /info before constructing orders; do not hardcode asset IDs, decimals, leverage, or tick rules.
  2. Keep signing keys outside source code and use an API wallet only for permitted L1 actions. Never expose private keys in prompts, logs, generated documentation, or agent context.
  3. For testnet funding, use the documented faucet at https://app.hyperliquid-testnet.xyz/drip and account for its eligibility requirements.

Hyperliquid API Reference Data Schema & Taxonomy

Reference metadata

Field Value
Skill name hyperliquid-api-reference
Version 1.0.0
License MIT
Author Galleon Labs
Primary documentation Hyperliquid developer API documentation
Verification note Verified against the official docs on 2026-08-16

API organization

  • REST endpoints: Mainnet and testnet /info for unsigned reads and /exchange for signed actions.
  • WebSocket channels: Market data, candles, order books, trades, account state, fills, funding, ledger updates, TWAP state, and notifications.
  • HyperEVM: Separate RPC endpoints with chain 999 on mainnet and 998 on testnet.
  • Read payloads: /info requests use a type field with request-specific parameters and return the bare payload.
  • Write payloads: /exchange requests contain an action, millisecond nonce, signature, and optional vault or expiration fields; responses use ok or err status.

Trading data taxonomy

  • Market metadata: meta, spotMeta, perpDexs, allPerpMetas, and asset context responses.
  • Market activity: allMids, l2Book, recentTrades, candleSnapshot, funding history, and predicted funding.
  • Account state: Clearinghouse state, spot balances, open orders, historical orders, fills, funding, ledger updates, portfolio, fees, and rate limits.
  • Identity and permissions: User role, extra agents, subaccounts, vault details, delegations, referral data, and builder-fee permissions.
  • Order vocabulary: Limit, IOC, GTC, ALO, trigger, TP/SL, reduce-only, TWAP, resting, filled, canceled, rejected, and waiting states.
  • Asset identifiers: Perp indexes from live meta, spot IDs beginning at 10000, HIP-3 IDs using dex offsets, and HIP-4 outcome encodings.
  • Operational constraints: Price significant figures, decimal limits, size decimals, minimum notional, open-order caps, nonce windows, pagination, and REST/WebSocket quotas.

Historical time-ranged ledger and funding queries return up to 500 items per response; continue pagination with the last returned time. Many list-style reads cap responses at 2,000 items, while candles return only the most recent 5,000 snapshots.

Hyperliquid API Reference Advanced Features

  • Supports the complete /info request catalog, including market data, derivatives metadata, spot metadata, account state, portfolio, funding, fees, referrals, vaults, delegations, borrowing, and asset deployment information.
  • Covers L1 API-wallet signing with msgpack, keccak, EIP-712 Agent domains, source selection, vault fields, expiration, and nonce validation.
  • Documents user-signed EIP-712 actions and clearly identifies actions that require the account's main wallet rather than the desk's API wallet.
  • Provides exact order, cancellation, trigger, TWAP, leverage, margin, builder-fee, subaccount, transfer, and withdrawal action boundaries.
  • Includes WebSocket subscription types, ping/pong heartbeats, socket post requests, idle timeouts, connection quotas, subscription limits, and in-flight message limits.
  • Captures detailed order-status and cancellation vocabularies for robust state machines and reconciliation logic.
  • Includes practical error-string mapping for precision errors, margin failures, TP/SL validation, liquidity, oracle distance, open-interest caps, and signature recovery failures.
  • Records mainnet and testnet differences, including endpoint URLs, chain IDs, environment-specific asset IDs, faucet guidance, and margin behavior.
  • Helps Openclaw Skills agents apply live metadata, pagination, rate-limit weighting, and risk constraints before producing executable trading code.
  • Links each major topic to the official Hyperliquid pages for ongoing verification when the API evolves.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*