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

# WebSocket API Overview

> Real-time market data and account updates via WebSocket

The Decibel WebSocket API provides real-time streaming data for markets, orderbooks, trades, and account updates. Use it instead of polling the REST API for time-sensitive data.

**All connections require authentication.** Anonymous WebSocket connections will be disabled. See [Connection Management](/api-reference/websocket/connection) for auth details.

## Server URL

| Network | URL                                          |
| ------- | -------------------------------------------- |
| Testnet | `wss://api.testnet.aptoslabs.com/decibel/ws` |
| Mainnet | `wss://api.mainnet.aptoslabs.com/decibel/ws` |

## Available Channels

### Market Data

| Channel                                      | Description                                                                                                                                                  |
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `depth:{marketAddr}`                         | Orderbook depth updates. Optional aggregation level suffix: `depth:{marketAddr}:{level}` where level is `1`, `2`, `5`, `10`, `100`, or `1000` (default: `1`) |
| `trades:{marketAddr}`                        | Trade stream for a market                                                                                                                                    |
| `market_price:{marketAddr}`                  | Real-time price, funding rate, and open interest for a market                                                                                                |
| `all_market_prices`                          | Price updates for all markets                                                                                                                                |
| `market_candlestick:{marketAddr}:{interval}` | OHLCV candlestick data. Intervals: `1m`, `5m`, `15m`, `30m`, `1h`, `2h`, `4h`, `1d`, `1w`, `1mo`                                                             |

### Account

| Channel                             | Description                                  |
| ----------------------------------- | -------------------------------------------- |
| `account_open_orders:{accountAddr}` | Open orders for an account                   |
| `order_updates:{accountAddr}`       | Order status change events                   |
| `account_positions:{accountAddr}`   | Open positions for an account                |
| `account_overview:{accountAddr}`    | Account equity, margin, and balances         |
| `user_trades:{accountAddr}`         | Trade fills for a user                       |
| `notifications:{accountAddr}`       | Real-time notifications (liquidations, etc.) |

### Bulk Orders

| Channel                               | Description                 |
| ------------------------------------- | --------------------------- |
| `bulk_orders:{accountAddr}`           | Bulk order status updates   |
| `bulk_order_fills:{accountAddr}`      | Bulk order fill events      |
| `bulk_order_rejections:{accountAddr}` | Bulk order rejection events |

### TWAP

| Channel                           | Description                   |
| --------------------------------- | ----------------------------- |
| `user_active_twaps:{accountAddr}` | Active TWAP orders for a user |

## Message Format

See [Connection Management](/api-reference/websocket/connection#subscribe-unsubscribe) for the subscribe/unsubscribe format, authentication, and example messages.

## Next Steps

<CardGroup cols={2}>
  <Card title="Connection Management" href="/api-reference/websocket/connection">
    How to connect, authenticate, and handle reconnection
  </Card>

  <Card title="TypeScript SDK" href="/typescript-sdk/overview">
    Use the SDK for managed WebSocket connections
  </Card>
</CardGroup>
