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

# WebSocket Overview

## Connection

```text theme={null}
wss://ws.notional.xyz
```

## Protocol

Client messages:

* `subscribe`
* `unsubscribe`
* `ping`

Server messages:

* channel payloads
* `subscriptionResponse`
* `pong`
* `error`

## Subscription Types

### User-scoped

* `userFills`
* `accountSummary`
* `userOrderRejections`
* `orderUpdates`
* `activeAssetData`
* `userTransactions`
* `twapUpdates`

For `activeAssetData`, both `user` and `coin` are enforced by the server. For the other user-scoped channels, clients should still always include `user` even though the current server only hard-validates `activeAssetData`.

`twapUpdates` sends an initial snapshot of the user's active TWAPs and then incremental progress updates as execution continues.

### Global

* `newBlocks`
* `newTransactions`
* `notionalMeta`

## Message Examples

Subscribe:

```json theme={null}
{
  "method": "subscribe",
  "subscription": {
    "type": "userFills",
    "user": "0x742d35cc6634c0532925a3b844bc9e7595f0beb"
  }
}
```

Ping:

```json theme={null}
{
  "method": "ping"
}
```

Pong:

```json theme={null}
{
  "channel": "pong"
}
```

Error:

```json theme={null}
{
  "channel": "error",
  "data": {
    "message": "Invalid message format"
  }
}
```

## Connection Management

* Idle timeout is 60 seconds.
* Send a JSON `ping` about every 30 seconds if the client is otherwise idle.
* Re-subscribe after reconnecting.
