# Hyperliquid WS · API reference · Femtos

> Hyperliquid’s WebSocket subscriptions, served from our node. WebSocket channel /ws on HyperCore: parameters, response fields and a live call per layer.

- Base URL: `https://api.femtos.xyz/v1` (REST) · `wss://api.femtos.xyz/v1/ws` (WebSocket) · MCP: `https://api.femtos.xyz/mcp`
- Auth: `Authorization: Bearer $FEMTOS_KEY`. Free key: https://femtos.xyz/account/new (browser), or with
  no browser: `GET https://femtos.xyz/accounts/agent/challenge`, solve its proof of work, then `POST https://femtos.xyz/accounts/agent/signup`
  (https://femtos.xyz/agents.md#agent-onboarding)
- Decimals are exact strings, times Unix milliseconds, addresses lowercase `0x`
- Whole API in one file: https://femtos.xyz/agents.md · OpenAPI: https://api.femtos.xyz/v1/openapi.json · Index: https://femtos.xyz/llms.txt
- Page with live calls: https://femtos.xyz/reference/hl/ws

## Hyperliquid WS — WS `/ws`

Hyperliquid’s WebSocket subscriptions, served from our node.

Same frames as `wss://api.hyperliquid.xyz/ws`, on `wss://api.femtos.xyz/ws?token=$FEMTOS_KEY`.

| Field | Type | Meaning |
|---|---|---|
| `{"method":"subscribe","subscription":{…}}` | frame | same frames as api.hyperliquid.xyz/ws |
| `trades · l2Book · candle · allMids · bbo` | type | market subscriptions |
| `userFills · orderUpdates` | type | one account |

Subscriptions served (11; * = required; a `post` carries a POST /info body):

| `type` | Other fields | What |
|---|---|---|
| `trades` | coin* | Trades of a coin (raced between our node and Hyperliquid's public feed) |
| `l2Book` | coin*, nSigFigs, mantissa, fast | Book of a coin, 20 levels per side |
| `candle` | coin*, interval* | The forming candle of a coin |
| `allMids` | dex | Mid prices of every coin |
| `bbo` | coin* | Best bid and offer of a coin |
| `userFills` | user*, aggregateByTime | A user's fills (isSnapshot first) |
| `orderUpdates` | user* | A user's order status changes |
| `userFundings` | user* | A user's funding payments (isSnapshot first) |
| `userNonFundingLedgerUpdates` | user* | A user's non-funding ledger updates (isSnapshot first) |
| `activeAssetCtx` | coin* | Asset context of a coin: mark, funding, open interest |
| `allDexsAssetCtxs` | - | Asset contexts of every perp dex |

## Related (Hyperliquid-compatible)

- [POST /info](https://femtos.xyz/reference/hl/info.md) `POST /info`: Hyperliquid’s /info request bodies, answered from our node. (HyperCore)

Every page: https://femtos.xyz/reference.md
