> For the complete documentation index, see [llms.txt](https://docs.coinmarketman.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coinmarketman.com/real-time-websocket-streams/key-concepts.md).

# Key Concepts

## Key concepts

### Connections, channels, and messages

A **connection** is one WebSocket or SSE link. Authenticate once when it opens. One connection can receive many streams.

A **channel** identifies a stream. Subscribe to a channel to receive events. A **message** is a JSON event in `data`.

| Channel                                           | Filter field | Replay         |
| ------------------------------------------------- | ------------ | -------------- |
| `rooms:fills`, `rooms:misc_events`, `rooms:twaps` | `tf`         | Yes            |
| `orders:feed`                                     | `data`       | No — live only |

Filter syntax is identical across channels. Only the carrying field differs.

### Tags and filtering

`rooms:*` messages carry tags such as `coin`, `side`, and `address`. Filters use tags. The full event remains in `data`.

`orders:feed` filters the same way. Its tags are not sent to clients. Read values from `data`.

### Additional fields on every message

| Field         | Description                                                     |
| ------------- | --------------------------------------------------------------- |
| `id`          | Unique event ID. Use it to discard duplicates.                  |
| `blockNumber` | Source Hyperliquid block.                                       |
| `blockTime`   | Block time.                                                     |
| `localTime`   | When the event was first observed.                              |
| `sentTime`    | Send time in milliseconds. Measure delay with `now − sentTime`. |

For fills and orders, `id` is a string. Keep it as text. Order IDs are opaque. Use them only for matching or deduplication.

### Recovery

`rooms:*` channels support short-window replay. Record the channel `epoch` and latest `offset`. Reconnect with both values to request missed messages.

Replay covers only a few hundred messages and a few minutes. Fills may cover only seconds. Recovery is all-or-nothing. Use REST history for larger gaps.

### Delivery behavior

* Events may arrive more than once. Discard already processed `id` values.
* Slow clients are disconnected with `3008 slow`.
* Keep handlers fast and use narrow filters.

### Plain-WebSocket message format

* Send `connect` first.
* Every command has an `id`. Replies return that ID.
* Events look like `{"push":{"channel":"…","pub":{"data":…,"offset":…}}}`.
* Reply `{}` to each `{}` ping.
* Split every frame on `\n` before parsing.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.coinmarketman.com/real-time-websocket-streams/key-concepts.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
