> ## Documentation Index
> Fetch the complete documentation index at: https://dexbuilder.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# WebSocket 概览

> 连接事件合约 WebSocket，接收实时公开行情和认证账户事件。

事件合约 WebSocket API 提供公共行情数据和需要认证的账户更新。

## 连接

```text theme={null}
wss://broker.dexbuilder.com/ws/dex-builder/event-contracts
```

在同一产品的频道中复用一个连接。事件合约使用 `ec.*` 前缀。

## 频道分组

* 公共频道：`ec.trades`、`ec.depth`、`ec.bbo`、`ec.status`、`ec.cpi`、`ec.candlestick`、`ec.oc_price`
* 私有频道：`ec.orders`、`ec.usertrades`、`ec.positions`、`ec.settlements`

公共频道不需要认证，私有频道需要 API Key 签名。请参阅[WebSocket 协议](https://dexbuilder.mintlify.site/zh/event-contracts/websocket/protocol.md)、[公共频道](https://dexbuilder.mintlify.site/zh/event-contracts/websocket/public-channels.md)和[私有频道](https://dexbuilder.mintlify.site/zh/event-contracts/websocket/private-channels.md)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.