> 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 Public Market Data Channels

> Stream 6MM order books, trades, candlesticks, and ticker data through public WebSocket channels with subscription and reconnect guidance.

Use public market channels when an application needs continuously updated prices, trades, candlesticks, or order-book depth without repeatedly polling REST endpoints. These streams can support trading screens, price displays, alerts, and market monitoring.

## Connection URL

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

Public WebSocket does not require authentication.

For connection lifecycle, unsubscribe, ping, and reconnect behavior, see [Connection, Subscription & Heartbeat](/developer-api/websocket/connection-subscription-and-heartbeat).

## 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                                          |

## Choose a channel

| Application need                | Channel                            |
| ------------------------------- | ---------------------------------- |
| Build or maintain an order book | `market.depth.{symbol}`            |
| Display a live trade feed       | `market.trade.{symbol}`            |
| Draw a candlestick chart        | `market.kline.{symbol}.{interval}` |
| Display one market summary      | `market.ticker.{symbol}`           |
| Maintain a market overview      | `market.tickers`                   |

## Subscription Example

```json
{ "id": "1772007814666", "op": "subscribe", "args": ["market.depth.BTCUSDT"] }
```

## Push Message Wrapper

```json
{
  "topic": "market.depth.BTCUSDT",
  "event": "data",
  "ts": 1772007815000,
  "data": {}
}
```

Use `topic` to route each message to the correct handler and `ts` to observe delivery timing. The `data` object contains the payload for the subscribed channel.

## Order-book handling

The depth channel sends a snapshot first and then incremental updates. Initialize the local book from the snapshot before applying updates. After reconnecting, create a new session, subscribe again, and rebuild the local book from the next snapshot instead of continuing from stale in-memory state.

## Production recommendations

* Generate a unique `id` for every subscribe, unsubscribe, and ping request.
* Confirm subscription acknowledgements before treating a channel as active.
* Resubscribe to every required topic after reconnecting.
* Keep network reads separate from slower database or UI processing.
* Monitor disconnect frequency, message-processing lag, and malformed payloads.
* Use [Private User Channel](/developer-api/websocket/private-user-channel) for authenticated account and order updates.

## Related API docs

#### [WebSocket Overview](/developer-api/websocket)

Choose between public and private streaming connections.

#### [Connection & Heartbeat](/developer-api/websocket/connection-subscription-and-heartbeat)

Implement subscribe, unsubscribe, ping, and reconnect handling.

#### [REST Market Data](/developer-api/rest-api/market-data)

Use request-based market data alongside streaming channels.