๐Ÿ”Œ API & Developers

Hyperliquid WebSocket Subscriptions: Message Formats, Types, and Examples

โš ๏ธ Disclosure: Some links on this page are affiliate links. If you sign up through them, I may earn a commission โ€” at no extra cost to you. I only review tools I actually use.
To subscribe to a Hyperliquid WebSocket data feed, send a JSON subscription message with method set to "subscribe" and a subscription object describing the feed. This reference uses the Hyperliquid WebSocket subscriptions docs retrieved on 2026-11-09; the docs page says it was last updated 23 days ago.

Subscription message

The subscription message format is:

{
  "method": "subscribe",
  "subscription": {
    "type": "<subscription_type>"
  }
}

The subscription object must include the type-specific properties for the feed you want.

For time-series data, such as user fills, the subscription acknowledgement can include a snapshot of previous data. Snapshot messages are tagged with isSnapshot: true. If you have already processed the previous messages, you can ignore the snapshot.

Supported subscription types

The following subscription types are documented in the source.

TypeSubscription fieldsNotes / data format
allMidsdex optionalAllMids. If dex is omitted, the first perp dex is used. Spot mids are only included with the first perp dex.
notificationuserNotification
webData3userWebData3
twapStatesuser, dexTwapStates
clearinghouseStateuser, dexClearinghouseState
openOrdersuser, dexOpenOrders
candlecoin, intervalCandle[]. Supported intervals: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1d, 3d, 1w, 1M.
l2Bookcoin; optional nSigFigs, mantissa, fastWsBook. fast: true gives 5 levels; slow mode gives 20 levels.
tradescoinWsTrade[]
orderUpdatesuserWsOrder[]
userEventsuserWsUserEvent. The channel name for these messages is "user".
userFillsuser; optional aggregateByTimeWsUserFills
userFundingsuserWsUserFundings
userNonFundingLedgerUpdatesuserWsUserNonFundingLedgerUpdates
activeAssetCtxcoinWsActiveAssetCtx or WsActiveSpotAssetCtx
activeAssetDatauser, coinWsActiveAssetData. Supports Perps only.
userTwapSliceFillsuserWsUserTwapSliceFills
userTwapHistoryuserWsUserTwapHistory
bbocoinWsBbo
spotStateuser; optional isPortfolioMarginWsSpotState
allDexsClearinghouseStateuserWsAllDexsClearinghouseState
allDexsAssetCtxsnoneWsAllDexsAssetCtxs
outcomeMetaUpdatesnoneWsOutcomeMetaUpdates
fastAssetCtxsnoneBase64-encoded and compressed WsFastAssetCtxs

Example subscription messages

The examples below are constructed from the documented subscription formats.

Subscribe to all mid prices:

{
  "method": "subscribe",
  "subscription": {
    "type": "allMids",
    "dex": "<dex>"
  }
}

Subscribe to notifications for a user:

{
  "method": "subscribe",
  "subscription": {
    "type": "notification",
    "user": "<address>"
  }
}

Subscribe to candle updates:

{
  "method": "subscribe",
  "subscription": {
    "type": "candle",
    "coin": "<coin_symbol>",
    "interval": "1m"
  }
}

Subscribe to order book updates:

{
  "method": "subscribe",
  "subscription": {
    "type": "l2Book",
    "coin": "<coin_symbol>"
  }
}

Subscribe to user fills:

{
  "method": "subscribe",
  "subscription": {
    "type": "userFills",
    "user": "<address>"
  }
}

๐Ÿ’ก Hyperliquid

Like what you're reading? Try it yourself โ€” this link supports ChartedTrader at no cost to you.

Create a Hyperliquid account (4% fee discount on first $25M volume; Vaults and sub-accounts excluded) โ†’
๐ŸŽ You receive: 4% fee discount on first $25M volume ยท per account, lifetime

Response and data formats

For a successful subscription, the server responds with a message whose channel property is "subscriptionResponse". The data field contains the original subscription.

After that, the server sends messages with the channel property set to the corresponding subscription type, for example "allMids", and the data field contains the subscribed data.

For streaming user endpoints such as WsUserFills and WsUserFundings, the first message has isSnapshot: true, and subsequent streaming updates have isSnapshot: false.

Other documented behavior includes:

User address pitfall

For account-data subscriptions, pass the actual address of the master or sub-account you want to query. A common pitfall is using an agent wallet address, which can lead to an empty result.

fastAssetCtxs decoding

The fastAssetCtxs feed returns base64-encoded and compressed WsFastAssetCtxs data. The docs specify this decode order:

  1. Base64-decode to bytes.
  2. Decompress as a raw DEFLATE stream, RFC 1951. There is no zlib RFC 1950 or gzip RFC 1952 wrapper.
  3. UTF-8 decode and parse as JSON.
Documented implementation references: The docs include this test payload:

q1ZyCnFWsqpWyk0syg6oULJSsjQ3NTDQM1Wq1VFyDfFAkTI2MzXQMwJLVVRWWfmFuTiiyBuamOoZKdXWAgA=

Decoded result:

{
  "BTC": {
    "markPx": "97500.5"
  },
  "ETH": {
    "markPx": "3650.25"
  },
  "xyz:NVDA": {
    "markPx": "145.2"
  }
}

The first fastAssetCtxs message is a snapshot. Subsequent messages contain only coins that have updated, and fields with no updates are omitted.

Unsubscribing

To stop receiving a feed, send the unsubscribe message described in the docs. The subscription object should match the original subscription message so the server can identify the feed.

Unsubscribing from one feed does not affect other active subscriptions. To unsubscribe from multiple feeds, send multiple unsubscribe messages, each with the appropriate subscription details.

Create a Hyperliquid account

This article contains a Hyperliquid referral link. If you sign up, we may earn a commission. The offer provides a 4% fee discount on the first $25M of volume per account. Vaults and sub-accounts are excluded.

Create a Hyperliquid account

Continue with Hyperliquid

Browse the Hyperliquid guide hub for the complete user journey.

๐Ÿงฎ Free Hyperliquid calculators

Fee Calculator โ†’
Hyperliquid vs centralized exchange fee comparison
PnL & Liquidation โ†’
Perp PnL + liquidation price
Position Size โ†’
Risk-aware position sizing for HL perps
Hyperliquid

Ready to get started? Use the link below โ€” it helps support ChartedTrader at no cost to you.

Create a Hyperliquid account (4% fee discount on first $25M volume; Vaults and sub-accounts excluded) โ†’
๐ŸŽ You receive: 4% fee discount on first $25M volume ยท per account, lifetime
๐Ÿ“ˆ

About the author

I'm a systematic trader running live strategies on IB (USDJPY momentum) and Hyperliquid (crypto perps). Every tool reviewed here is something I've used with real capital. Questions? Reach out.

๐Ÿ“š Related Articles

๐Ÿ”Œ
API & Developers

Hyperliquid API Websocket Guide for Developers (2026)

Connect to Hyperliquid WebSocket endpoints, subscribe to basic feeds, send post requests, and keep the connection alive with ping/pong and reconnect handling.

July 29, 2026 โฑ 8 min read
๐Ÿ”Œ
API & Developers

Hyperliquid WebSocket Trades and Candles: Snapshot, Dedupe Key, and Finality

Use the official WsTrade recommendation (block_time, coin, tid) for global uniqueness, and treat candle pushes as mutable interval state.

November 15, 2026 โฑ 4 min read
๐Ÿ”ง
Troubleshooting & Fixes

Hyperliquid Python SDK: Fix WebSocket Reconnect Subscription Drops and Duplicates (2026)

How the Hyperliquid Python SDK WebSocketManager can drop post-connect subscriptions and duplicate pre-connect ones after reconnect, with the reported code locations and fix.

November 14, 2026 โฑ 5 min read