> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.6mm.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.6mm.com/_mcp/server.

# WebSocket

> Connect to the 6MM WebSocket service for public market streams and private account events, with heartbeat and subscription guidance.

## Service Endpoint

```
wss://ws.6mm.com/ws
```

WebSocket channels are divided into public channels and private channels:

| Type             | Authentication              | Description                                            |
| ---------------- | --------------------------- | ------------------------------------------------------ |
| Public channels  | Not required                | Market data, such as depth, trades, Klines, and ticker |
| Private channels | `listenKey` or JWT required | User order, account, and position streams              |

## Public Channels

Public WebSocket does not require authentication. After connecting, send a `subscribe` request to subscribe to market channels.

Common channels:

| Channel                            | Description                                                        |
| ---------------------------------- | ------------------------------------------------------------------ |
| `market.depth.{symbol}`            | Order book depth. Sends a snapshot first, then incremental updates |
| `market.trade.{symbol}`            | Latest trades                                                      |
| `market.kline.{symbol}.{interval}` | Klines                                                             |
| `market.ticker.{symbol}`           | Single-symbol ticker summary                                       |
| `market.tickers`                   | All-symbol ticker summary                                          |

## Private Channels

## listenKey

For private WebSocket streams, create a `listenKey` through the REST API first, then connect to:

```
wss://ws.6mm.com/ws?listenKey=YOUR_LISTEN_KEY
```

## JWT

Compatible JWT connection method:

```
wss://ws.6mm.com/ws?token=YOUR_ACCESS_TOKEN
```

After authentication succeeds, the server automatically subscribes the connection to the current user's private channel. No manual subscription is required.

## Choose the next guide

* [Connection, Subscription & Heartbeat](/developer-api/websocket/connection-subscription-and-heartbeat): connection lifecycle, ping, reconnect, and resubscription.
* [Public Market Channels](/developer-api/websocket/public-market-channels): depth, trades, Klines, tickers, and sequence handling.
* [Private User Channel](/developer-api/websocket/private-user-channel): listenKey lifecycle and authenticated account events.
* [Integration Recommendations](/developer-api/integration-recommendations): monitoring, idempotency, retries, and production testing.