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

公共頻道無需認證，私有頻道需要 Broker API Key 簽名。請參閱[WebSocket 協議](https://dexbuilder.mintlify.site/zh-TW/event-contracts/websocket/protocol.md)、[公共頻道](https://dexbuilder.mintlify.site/zh-TW/event-contracts/websocket/public-channels.md)和[私有頻道](https://dexbuilder.mintlify.site/zh-TW/event-contracts/websocket/private-channels.md)。


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