Zero to HYPE

T2 · Foundations

Reading the exchange

Every number a bot or dashboard needs, from the info endpoint and WebSocket feeds, with the rules for asset IDs, decimals and rate limits.

LessonChecked against the live API on 22 Oct 2026

Read first

The official docs for this track.

Then

Tutorials and write-ups worth your time.

Build

Hands-on work for this track.

  • Lab: Live order book in the browserComing
  • Workbench: Tick and lot roundingComing

Ask with one request type

Everything public goes through POST /info with a JSON body naming a type. No key or signature is needed, and browsers may call it directly from any site. These are the requests most projects start with, all checked against mainnet on Oct 22, 2026:

Request Returns Weight
allMids Mid price of every coin 2
l2Book (coin) Order book levels for one coin 2
clearinghouseState (user) An account’s margin, positions and withdrawable balance 2
meta Perp universe: names, szDecimals, max leverage 20
metaAndAssetCtxs meta plus live oracle, mark, mid, funding and open interest per perp 20
openOrders (user) Resting orders 20
userFills (user) Up to 2,000 most recent fills 20, plus more per 20 fills
candleSnapshot Candles for a coin and interval 20, plus more per 60 candles
fundingHistory Funding rates over time 20, plus more per 20 items
spotMeta, spotMetaAndAssetCtxs Spot tokens and pairs, with live prices 20
perpDexs Every HIP-3 DEX, its deployer and settings 20
outcomeMeta Every HIP-4 outcome and question 20

Requests about a HIP-3 DEX take a dex field. {"type":"meta","dex":"xyz"} returns trade[XYZ]’s perps, named xyz:XYZ100 and so on.

Every market type names its assets differently

Orders refer to assets by number, and each market type numbers them its own way.

Market Asset ID Coin name
Perp on the main DEX Index in meta.universe (BTC is 0 on mainnet) BTC
Perp on a HIP-3 DEX 100000 + dex index × 10000 + index in that DEX's meta xyz:XYZ100
Spot pair 10000 + index of the pair in spotMeta.universe PURR/USDC, or @107
Outcome side 100000000 + 10 × outcome + side #10 for outcome 1, side 0

Spot pair IDs are not token IDs. On mainnet HYPE is token 150 but spot pair 107, and testnet uses different numbers for both.

Watch out. In spotMetaAndAssetCtxs, the list of price contexts is longer than the list of pairs and does not stay in the same order. On Oct 22, 2026 the two stopped lining up at position 71 on mainnet and at position 4 on testnet. Match each context to its pair by coin, never by position.

Prices and sizes have strict precision

The exchange rejects an order whose numbers have too much precision.

For example, 1234.5 is a valid price but 1234.56 isn’t, because it has six significant figures.

Stream instead of polling

Use the WebSocket for anything live. Subscribe with one message per feed:

{ "method": "subscribe", "subscription": { "type": "trades", "coin": "BTC" } }

The server answers each subscription with a subscriptionResponse. A subscription the server doesn’t recognise gets an error message instead and then stays silent, so check for both. These subscriptions answered on mainnet on Oct 22, 2026: allMids, l2Book, trades, bbo, candle, activeAssetCtx and userFills.

Servers disconnect clients now and then without warning. Reconnect automatically; the first message after you resubscribe is a snapshot covering what you missed.

Stay inside the limits

Per IP address:

Per address, every account starts with 10,000 requests and earns one more for each 1 USDC it trades. Accounts may hold up to 1,000 open orders by default.

History is short

The API keeps only recent history:

For anything older, use the historical data archives, a node (T10), or record it yourself as you go.