Hyperliquid Api Reference logo

Hyperliquid Api Reference

Organization
galleonlabs
hyperliquid-api-reference

Compact reference for the Hyperliquid API as the desk uses it - endpoints and envelopes, every /info request type, every /exchange action with its signing scheme, order and status vocabularies, asset ids, tick and lot rules, rate limits, WebSocket subscription list, error strings, and where the official docs are. Use to look up an exact field, request type or limit before writing a call, and to map an error string to its cause.

Overview

Publishergalleonlabs
Repositoryhypergrok-trading-desk
Skill namehyperliquid-api-reference
Stars
145
Forks
31
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by galleonlabs on GitHub. Read the source before you install it.

Installation

Install the Hyperliquid Api Reference AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/galleonlabs/hypergrok-trading-desk/tree/main/skills/hyperliquid-api-reference
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/galleonlabs/hypergrok-trading-desk.git /tmp/hypergrok-trading-desk
mkdir -p .claude/skills
cp -r /tmp/hypergrok-trading-desk/skills/hyperliquid-api-reference .claude/skills/hyperliquid-api-reference
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Hyperliquid Api Reference in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Hyperliquid Api Reference on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Hyperliquid Api Reference is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Hyperliquid API reference (desk edition)

Verified against the official docs on 2026-08-16. When in doubt, fetch the page: append .md to any docs URL for raw markdown, for example https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint.md.

Endpoints

MainnetTestnet
RESThttps://api.hyperliquid.xyzhttps://api.hyperliquid-testnet.xyz
WebSocketwss://api.hyperliquid.xyz/wswss://api.hyperliquid-testnet.xyz/ws
HyperEVM RPChttps://rpc.hyperliquid.xyz/evm (chain 999)https://rpc.hyperliquid-testnet.xyz/evm (chain 998)
  • POST /info body {"type": "<request>", ...}, unsigned; response is the bare payload. Unknown type or missing field: HTTP 422; invalid JSON: HTTP 400.
  • POST /exchange body {"action": {...}, "nonce": <ms>, "signature": {"r","s","v"}, "vaultAddress"?: "0x...", "expiresAfter"?: <ms>}; response {"status":"ok","response":{"type":"order"|"cancel"|"default"|..., "data"?: {...}}} or {"status":"err","response":"<string>"}, both HTTP 200.
  • Header Content-Type: application/json.

/info request types

typeparamsreturns
allMidsdex?{coin: midPx}
metadex?{universe:[{name, szDecimals, maxLeverage, marginTableId?, onlyIsolated?, marginMode?, isDelisted?}], marginTables:[[id,{description, marginTiers:[{lowerBound, maxLeverage}]}]]}
metaAndAssetCtxsdex?[meta, [{funding, openInterest, prevDayPx, dayNtlVlm, premium, oraclePx, markPx, midPx, impactPxs}]]
spotMeta{tokens:[{name, szDecimals, weiDecimals, index, tokenId, ...}], universe:[{name, tokens:[base,quote], index}]}
spotMetaAndAssetCtxs[spotMeta, [{dayNtlVlm, markPx, midPx, prevDayPx, circulatingSupply}]]
l2Bookcoin, nSigFigs? (2-5), mantissa? (1,2,5){coin, time, levels:[[{px,sz,n}...bids],[...asks]]} up to 20 a side
recentTradescoin[{coin, side, px, sz, time, hash, tid}]
candleSnapshotreq:{coin, interval, startTime, endTime}[{t,T,s,i,o,c,h,l,v,n}], most recent 5000 only
fundingHistorycoin, startTime, endTime?[{coin, fundingRate (hourly), premium, time}]
predictedFundings[[coin, [[venue, {fundingRate, nextFundingTime, fundingIntervalHours?}]]]]; venue is HlPerp, BinPerp or BybitPerp, payload null when unlisted there. Normalise by fundingIntervalHours (HlPerp 1; CEX venues 4 or 8 per coin), never by a fixed 8
perpsAtOpenInterestCapdex?[coin]
perpDexs[null, {name, fullName, deployer, ...}]
clearinghouseStateuser, dex?{assetPositions:[{type, position:{coin, szi, entryPx, leverage{type,value,rawUsd?}, liquidationPx, marginUsed, positionValue, unrealizedPnl, returnOnEquity, cumFunding, maxLeverage}}], marginSummary{accountValue,totalNtlPos,totalRawUsd,totalMarginUsed}, crossMarginSummary, crossMaintenanceMarginUsed, withdrawable, time}
spotClearinghouseStateuser{balances:[{coin, token, hold, total, entryNtl}]}
openOrdersuser, dex?[{coin, side (A/B), limitPx, sz, oid, timestamp}]
frontendOpenOrdersuser, dex?adds origSz, cloid, orderType, tif, reduceOnly, isTrigger, triggerPx, triggerCondition, isPositionTpsl, children
orderStatususer, oid (number or cloid hex){status:"order", order:{order, status, statusTimestamp}} or {status:"unknownOid"}
historicalOrdersuser[{order, status, statusTimestamp}] up to 2000
userFillsuser, aggregateByTime?[{coin, px, sz, side, time, startPosition, dir, closedPnl, hash, oid, crossed, fee, feeToken, builderFee?, tid, cloid?}] up to 2000
userFillsByTimeuser, startTime, endTime?, aggregateByTime?same, up to 2000 per call from the last 10000
userFundinguser, startTime, endTime?[{time, hash, delta:{type:"funding", coin, usdc, szi, fundingRate, nSamples}}]
userNonFundingLedgerUpdatesuser, startTime, endTime?deposits, withdrawals, transfers, liquidations, vault flows
userTwapSliceFillsuser[{fill, twapId}]
portfoliouser[["day",{accountValueHistory, pnlHistory, vlm}], ["week",...], ["month",...], ["allTime",...], perp variants]
userFeesuser{userCrossRate, userAddRate, userSpotCrossRate, userSpotAddRate, feeSchedule, activeReferralDiscount, activeStakingDiscount}
userRateLimituser{cumVlm, nRequestsUsed, nRequestsCap, nRequestsSurplus}
userRoleuser`{role: missing
extraAgentsuser[{address, name, validUntil}]
activeAssetDatauser, coin{leverage, maxTradeSzs:[buy,sell], availableToTrade:[buy,sell], markPx}
maxBuilderFeeuser, builderinteger (tenths of a bp)
subAccountsuser[{name, subAccountUser, master, clearinghouseState, spotState}]
vaultDetailsvaultAddress, user?vault info
userVaultEquitiesuser[{vaultAddress, equity}]
referral, delegations, delegatorSummary, delegatorHistory, delegatorRewards, userAbstraction, borrowLendUserState, tokenDetails, spotDeployState, perpDexLimits, allPerpMetasniche; see docs

Pagination for time-ranged reads: 500 items per response for ledger/funding style queries; use the last time as the next startTime.

/exchange actions

L1-signed actions can be signed by an API wallet; user-signed actions need the account's main wallet (the desk never has it).

actionparamsschemedesk
order`orders:[{a,b,p,s,r,t,c?}], grouping: nanormalTpslpositionTpsl, builder?`
cancelcancels:[{a,o}], f? (fast, omit if false)L1yes
cancelByCloidcancels:[{asset, cloid}]L1yes
modify / batchModifyoid (or cloid), order:{...} / modifies:[{oid, order}]; without a (always_place) the new order must be non-trigger and rest (Alo or non-executable Gtc)L1yes, resting limits only
scheduleCanceltime? (ms >= now+5s)L1yes, on request
updateLeverageasset, isCross, leverageL1yes
updateIsolatedMarginasset, isBuy, ntli (USD x 1e6, negative removes)L1yes
twapOrder / twapCanceltwap:{a,b,s,r,m (minutes),t (randomise)} / a, t (twapId); 5 min to 7 days, min 100 USDL1yes, on request
noopL1rarely
reserveRequestWeightweightL1user's call
vaultTransfer, subAccountTransfer, createSubAccount, subAccountSpotTransferL1no
approveAgentagentAddress, agentName?userin app
approveBuilderFeemaxFeeRate, builderuserno
usdSend, spotSend, sendAsset, withdraw3, usdClassTransferuserno
cDeposit, cWithdraw, tokenDelegate, userSetAbstractionuserno

Order fields: a asset index, b isBuy, p price string, s size string, r reduceOnly, t {"limit":{"tif":"Alo"|"Ioc"|"Gtc"}} or {"trigger":{"isMarket":bool,"triggerPx":"...","tpsl":"tp"|"sl"}}, c cloid (0x + 32 hex). Order statuses: {"resting":{"oid"}}, {"filled":{"totalSz","avgPx","oid"}}, "waitingForTrigger", "waitingForFill", {"error":"..."}. Cancel statuses: "success" or {"error":"..."}.

Order status vocabulary (orderStatus, historicalOrders, WS orderUpdates): open, filled, canceled, triggered, rejected, marginCanceled, vaultWithdrawalCanceled, openInterestCapCanceled, selfTradeCanceled, reduceOnlyCanceled, siblingFilledCanceled, delistedCanceled, liquidatedCanceled, scheduledCancel, tickRejected, minTradeNtlRejected, perpMarginRejected, reduceOnlyRejected, badAloPxRejected, iocCancelRejected, badTriggerPxRejected, marketOrderNoLiquidityRejected, positionIncreaseAtOpenInterestCapRejected, positionFlipAtOpenInterestCapRejected, tooAggressiveAtOpenInterestCapRejected, openInterestIncreaseRejected, insufficientSpotBalanceRejected, oracleRejected, perpMaxPositionRejected.

Signing (what the SDKs do for you)

  • L1 actions: msgpack the action, append nonce, vault flag/address and optional expiresAfter, keccak it, sign an EIP-712 Agent {source, connectionId} under domain Exchange (chainId 1337) where source is a for mainnet and b for testnet.
  • User-signed actions: EIP-712 typed data under domain HyperliquidSignTransaction with the action's hyperliquidChain (Mainnet/Testnet) and signatureChainId; the action's nonce/time must equal the outer nonce.
  • Nonce: unix ms; per signer; must exceed the 100th-highest used and lie within (now - 2 days, now + 1 day).
  • A bad signature surfaces as User or API Wallet 0x<recovered> does not exist., not as "bad signature".
  • Addresses lowercase; numbers as strings without trailing zeros; -0 becomes 0.

Asset ids and coin names

  • Perp: index in meta.universe (default dex). Read it live; never hardcode.
  • Spot: 10000 + index in spotMeta.universe; coin name PURR/USDC or @<index>; size decimals from the base token.
  • HIP-3 perps: 100000 + 10000 x dex index + index; name dex:COIN.
  • HIP-4 outcomes: 100000000 + encoding; names #<n>.
  • Ids differ between mainnet and testnet.

Tick and lot

  • Price: at most 5 significant figures and at most 6 - szDecimals decimals (perps) or 8 - szDecimals (spot). Integer prices are always valid.
  • Size: rounded to szDecimals. Round down on the desk.
  • Minimum order value: 10 USD (perps) / 10 quote tokens (spot). Max market order value scales with max leverage (30M for 25x+, down to 500k); limit orders 10x that.
  • Open orders per account: 1000 + 1 per 5M USDC volume, cap 5000; at 1000 open orders new reduce-only and trigger orders are rejected.

Rate limits

  • Per IP: 1200 weight per minute across REST. /exchange weight 1 + floor(n/40). /info weight 2 for l2Book, allMids, clearinghouseState, orderStatus, spotClearinghouseState, exchangeStatus; 60 for userRole; 20 for the rest; +1 per 20 items for list queries; candleSnapshot +1 per 60 candles.
  • Per address (actions): 10,000 buffer + 1 per 1 USDC cumulative volume; when exhausted, 1 action per 10 s; cancels get min(limit + 100000, 2 x limit). Stale expiresAfter rejections cost 5x. Unified/portfolio-margin accounts capped at 50k actions per day.
  • WebSocket per IP: 10 connections, 30 new per minute, 1000 subscriptions, 10 distinct users, 2000 messages per minute, 100 in-flight posts.

WebSocket

{"method":"subscribe","subscription":{...}}; heartbeat {"method":"ping"} / {"channel":"pong"}; idle connections closed after 60 s. Types: allMids, notification, webData3, candle, l2Book, trades, orderUpdates, userEvents (channel "user"), userFills, userFundings, userNonFundingLedgerUpdates, activeAssetCtx, activeAssetData, userTwapSliceFills, userTwapHistory, twapStates, bbo, clearinghouseState, openOrders, spotState, allDexsClearinghouseState, allDexsAssetCtxs, fastAssetCtxs. Post /info or signed actions over the socket with {"method":"post","id":n,"request":{"type":"info"|"action","payload":{...}}}.

Error strings

Price must be divisible by tick size. | Order must have minimum value of $10. | Insufficient margin to place order. | Reduce only order would increase position. | Post only order would have immediately matched, bbo was ... | Order could not immediately match against any resting orders. | Invalid TP/SL price. | No liquidity available for market order. | Order price too far from oracle | Order would cause position to exceed margin tier limit at current leverage | Order was never placed, already canceled, or filled. | User or API Wallet 0x... does not exist. | Must deposit before performing actions. User: 0x... | Invalid TWAP duration: ...

Trading facts the desk quotes

  • Funding: hourly, peer to peer, computed from an 8h formula paid 1/8 each hour, capped 4%/h, paid on oracle price; API rates are hourly.
  • Mark price (median of oracle-adjusted mid, book mid and CEX perp mids) drives margining, liquidation and TP/SL triggers.
  • Maintenance margin = half the initial margin at the tier's max leverage; partial liquidations first for large positions; cross liquidation price ignores the leverage setting.
  • Fees: base taker 0.045% / maker 0.015% perps, 0.07% / 0.04% spot, tiered by 14-day volume, staking and referral discounts; effective rates via userFees.
  • Testnet: same API; faucet at app.hyperliquid-testnet.xyz/drip (needs an address that has deposited on mainnet); much tighter margin tiers; asset ids differ.

Official pages worth fetching

for-developers/api/info-endpoint, .../info-endpoint/perpetuals, .../info-endpoint/spot, .../exchange-endpoint, .../signing, .../nonces-and-api-wallets, .../rate-limits-and-user-limits, .../tick-and-lot-size, .../asset-ids, .../error-responses, .../websocket/subscriptions, .../websocket/post-requests; trading/order-types, trading/take-profit-and-stop-loss-orders-tp-sl, trading/margining, trading/margin-tiers, trading/liquidations, trading/funding, trading/fees, trading/sub-accounts; onboarding/testnet-faucet. All under https://hyperliquid.gitbook.io/hyperliquid-docs/.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Hyperliquid Api Reference AI skill do?

Compact reference for the Hyperliquid API as the desk uses it - endpoints and envelopes, every /info request type, every /exchange action with its signing scheme, order and status vocabularies, asset ids, tick and lot rules, rate limits, WebSocket subscription list, error strings, and where the official docs are. Use to look up an exact field, request type or limit before writing a call, and to map an error string to its cause.

Why use Hyperliquid Api Reference on TypingMind?

Because you install it once and use it with any model. Hyperliquid Api Reference is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Hyperliquid Api Reference in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/galleonlabs/hypergrok-trading-desk/tree/main/skills/hyperliquid-api-reference. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Hyperliquid Api Reference?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Hyperliquid Api Reference?

As many as you like. As long as a model supports skills, you can use Hyperliquid Api Reference with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Hyperliquid Api Reference AI skill free?

Yes. It is published on GitHub by galleonlabs under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇