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

# Account TWAP Order Updates

> Streams each change to an account's TWAP orders, such as creation, sub-order fills, and cancellation.

Refer to [Websocket](https://docs.pacifica.fi/api-documentation/api/websocket) for establishing the websocket connection.

### Params

```json theme={null}
{
    "method": "subscribe",
    "params": {
        "source": "account_twap_order_updates",
        "account": "42trU9A5..."
    }
}
```

Each message carries one or more TWAP order events. Each row shows the TWAP order's state after its event, like a row of [Get TWAP order history](https://docs.pacifica.fi/api-documentation/api/rest-api/twap/get-twap-order-history.md). Reconcile rows by TWAP order ID (`i`).

This channel covers TWAP orders from [Create TWAP order](https://docs.pacifica.fi/api-documentation/api/rest-api/twap/create-twap-order.md). It does not cover TWAP order strategies.

### Stream

```json theme={null}
{
  "channel": "account_twap_order_updates",
  "data": [
    {
      "i": 13753364,
      "I": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
      "u": "42trU9A5...",
      "s": "BTC",
      "d": "bid",
      "ta": "0.121",
      "fa": "0.04",
      "lp": "87420",
      "lv": "87.42",
      "tv": "3496.5",
      "oe": "sub_order_executed",
      "os": "in_execution",
      "r": false,
      "sp": "0.5",
      "psa": "0.001",
      "psc": 121,
      "pasc": 40,
      "et": 1716203630000,
      "ct": 1716200000000,
      "ut": 1716201200000
    }
  ]
}
```

<table><thead><tr><th width="193">Field</th><th width="225">Type</th><th>Description</th></tr></thead><tbody><tr><td>`'i'`</td><td>integer</td><td>TWAP order ID</td></tr><tr><td>`'I'`</td><td>Full UUID string</td><td>Client order ID</td></tr><tr><td>`'u'`</td><td>string</td><td>Account</td></tr><tr><td>`'s'`</td><td>string</td><td>Symbol</td></tr><tr><td>`'d'`</td><td>string</td><td>Side: \[`bid`, `ask`]</td></tr><tr><td>`'ta'`</td><td>decimal string</td><td>Total amount</td></tr><tr><td>`'fa'`</td><td>decimal string</td><td>Filled amount</td></tr><tr><td>`'lp'`</td><td>decimal string</td><td>Average fill price of the latest sub-order that filled</td></tr><tr><td>`'lv'`</td><td>decimal string</td><td>Filled value (price × amount) of the latest sub-order that filled</td></tr><tr><td>`'tv'`</td><td>decimal string</td><td>Total filled value (price × amount) across all sub-orders</td></tr><tr><td>`'oe'`</td><td>string</td><td>TWAP order event (see below)</td></tr><tr><td>`'os'`</td><td>string</td><td>TWAP order status (see below)</td></tr><tr><td>`'r'`</td><td>bool</td><td>Reduce only</td></tr><tr><td>`'sp'`</td><td>decimal string</td><td>Maximum slippage for each sub-order, in percent</td></tr><tr><td>`'psa'`</td><td>decimal string</td><td>Planned amount of each sub-order</td></tr><tr><td>`'psc'`</td><td>integer</td><td>Number of planned sub-orders</td></tr><tr><td>`'pasc'`</td><td>integer</td><td>Number of planned sub-orders processed so far</td></tr><tr><td>`'et'`</td><td>integer</td><td>Expiration time (milliseconds)</td></tr><tr><td>`'ct'`</td><td>integer</td><td>Created at time (milliseconds)</td></tr><tr><td>`'ut'`</td><td>integer</td><td>Updated at time (milliseconds)</td></tr></tbody></table>

| Field | Value | Description |
| - | - | - |
| `'oe'` | `twap_created` | TWAP order created |
| | `sub_order_executed` | Sub-order placed |
| | `sub_order_failed` | Engine rejected a sub-order |
| | `cancel` | TWAP order cancelled |
| | `reject_sub_order_failure` | TWAP order stopped after a failed sub-order |
| | `expiration` | Expired with part of the amount unfilled |
| | `completion` | Full amount filled |
| `'os'` | `open` | No sub-order processed yet |
| | `in_execution` | Sending sub-orders |
| | `completed` | Full amount filled |
| | `cancelled` | Cancelled |
| | `expired` | Ended with part of the amount unfilled |
| | `rejected_due_to_sub_order` | Stopped because a sub-order was rejected |


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