> ## Documentation Index
> Fetch the complete documentation index at: https://api.docs.rocketfi.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Private WebSocket streams

> Account-scoped WebSocket feeds — orders, balances, positions, and related updates.

Private streams use the **same** **`/ws`** connection and **JSON** messaging model as public feeds, but the subscription kinds you choose carry **account** (and sometimes **instrument**) context in the **subscribe** payload—not an API key on the WebSocket handshake. Treat access control like the REST model: keys are for **SDK signing** off the socket; see **[Authentication](/guides/authentication)**.

## Why use private WebSockets

REST gives you snapshots; private streams push **incremental** updates for:

* Open orders and lifecycle changes
* Trades and fills attributed to your account
* Balances, margin, or position updates (when exposed for your subscription kinds)

Pair private streams with **[Private REST-API](/guides/private-rest-api)** for reconciliation and backfill after reconnects.

## Connection

1. Open **WSS** using the host for your network — **[Environments](/guides/environments)**.
2. Subscribe only after the connection is ready to accept **`Subscribe`** frames.

Exact transport-level requirements, if any, are defined by your deployment and **[AsyncAPI](/websocket-stream)**. **API keys** are configured in the **SDK** for signing **transactions**, not for repeating a secret as a WebSocket auth header by default.

## Stream pages (sidebar)

Expand **Streams** under this section for account-scoped subscriptions (order events, collateral, positions, open orders, and so on). Each page uses the same **`ws`** AsyncAPI channel with an individual title for that feed.

## Subscribing to account feeds

* Use the **`Subscribe`** kinds that take **account** or **address** parameters (see AsyncAPI).
* **Resubscribe** after every reconnect; state is not guaranteed to persist across sessions.
* Treat each message as a **partial update** unless the schema defines a full snapshot; on gap or sequence break, **reconnect** and **refresh** from REST if needed.

## Heartbeats

Send **`Ping`**; expect **`Pong`**. Private clients should be at least as aggressive as public bots about heartbeats when you hold long-lived connections through proxies.

## Errors and security

Errors arrive as **`ServerMessage::Error`** — see **[Error responses](/guides/errors)**. Never log API keys, signing material, or full account payloads to shared systems.

For **market-wide** data, see **[Public WebSocket streams](/guides/ws-public)** and the **[stream reference](/websocket-stream)**.
