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

# Get TWAP Order History

> This endpoint allows users to get a summarized TWAP order history.

```http theme={null}
GET /api/v1/orders/twap/history
```

Returns one row per TWAP order, open or finished, with its latest state. Rows are sorted by `order_id`, newest first. This history doesn't include TWAP order strategies. To see both kinds, use [Get TWAP record history](https://docs.pacifica.fi/api-documentation/api/rest-api/twap/get-twap-record-history.md).

#### Query Parameters

<table><thead><tr><th width="176">Field</th><th width="98">Type</th><th width="95">Need</th><th width="189">Description</th><th>Example</th></tr></thead><tbody><tr><td>`"account"`</td><td>string</td><td>required</td><td>Account address to filter TWAP orders</td><td>`42trU9A5...`</td></tr><tr><td>`"limit"`</td><td>integer</td><td>optional</td><td>Maximum number of records to return, default to 100. Values above 4000 are capped at 4000</td><td>`100`</td></tr><tr><td>`"cursor"`</td><td>string</td><td>optional</td><td>Cursor pagination to access records. Default to none</td><td>`1115hVka`</td></tr></tbody></table>

```http theme={null}
/api/v1/orders/twap/history?account=42trU9A5...&limit=100
```

#### Response

* Status 200: Successfully retrieved TWAP order history

```json theme={null}
{
  "success": true,
  "data": [
    {
      "order_id": 13753364,
      "client_order_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
      "symbol": "BTC",
      "side": "bid",
      "initial_amount": "0.121",
      "filled_amount": "0.04",
      "average_price_of_last_filled_sub_order": "87420",
      "value_of_last_filled_sub_order": "87.42",
      "total_filled_value": "3496.5",
      "order_status": "in_execution",
      "reduce_only": false,
      "slippage_percent": "0.500000000000",
      "planned_sub_order_amount": "0.001",
      "planned_sub_order_count": 121,
      "past_sub_order_count": 40,
      "expiration": 1716203630000,
      "created_at": 1716200000000,
      "updated_at": 1716201200000
    },
    ...
  ],
  "next_cursor": "1111Hyd74",
  "has_more": true
}
```

<table><thead><tr><th width="208">Field</th><th width="186">Type</th><th>Description</th></tr></thead><tbody><tr><td>`"order_id"`</td><td>integer</td><td>TWAP order ID</td></tr><tr><td>`"client_order_id"`</td><td>UUID or null</td><td>CLOID of the TWAP order if assigned by user</td></tr><tr><td>`"symbol"`</td><td>string</td><td>Trading pair symbol</td></tr><tr><td>`"side"`</td><td>string</td><td>Whether the order is a bid or an ask</td></tr><tr><td>`"initial_amount"`</td><td>decimal string</td><td>Total amount (in token denomination) of the TWAP order</td></tr><tr><td>`"filled_amount"`</td><td>decimal string</td><td>Amount (in token denomination) filled</td></tr><tr><td>`"average_price_of_last_filled_sub_order"`</td><td>decimal string</td><td>Average fill price of the latest sub-order that filled</td></tr><tr><td>`"value_of_last_filled_sub_order"`</td><td>decimal string</td><td>Filled value (price × amount) of the latest sub-order that filled</td></tr><tr><td>`"total_filled_value"`</td><td>decimal string</td><td>Total value (price × amount) filled across all sub-orders. Divide by `filled_amount` to get the average fill price</td></tr><tr><td>`"order_status"`</td><td>string</td><td>`"open"`: no sub-order processed yet\
`"in_execution"`: sending sub-orders\
`"completed"`: the full amount filled\
`"cancelled"`: cancelled, for example by a cancel request or a liquidation\
`"expired"`: ended with part of the amount unfilled\
`"rejected_due_to_sub_order"`: stopped because the engine rejected a sub-order</td></tr><tr><td>`"reduce_only"`</td><td>boolean</td><td>If each sub-order is reduce only</td></tr><tr><td>`"slippage_percent"`</td><td>decimal string</td><td>Maximum slippage for each sub-order, in percent</td></tr><tr><td>`"planned_sub_order_amount"`</td><td>decimal string</td><td>Planned amount (in token denomination) of each sub-order, set at creation</td></tr><tr><td>`"planned_sub_order_count"`</td><td>integer</td><td>Number of planned sub-orders</td></tr><tr><td>`"past_sub_order_count"`</td><td>integer</td><td>Number of planned sub-orders processed</td></tr><tr><td>`"expiration"`</td><td>integer</td><td>Timestamp in milliseconds when the TWAP order's time runs out</td></tr><tr><td>`"created_at"`</td><td>integer</td><td>Timestamp in milliseconds when the TWAP order was created on Pacifica</td></tr><tr><td>`"updated_at"`</td><td>integer</td><td>Timestamp in milliseconds of the TWAP order's latest event</td></tr><tr><td>`'next_cursor'`</td><td>string</td><td>Next cursor for pagination. Omitted when `'has_more'` is false</td></tr><tr><td>`'has_more'`</td><td>boolean</td><td>True if there exists a `'next_cursor'`</td></tr></tbody></table>

* Status 400: Invalid request parameters
* Status 500: Internal server error

#### Code Example (Python)

```python theme={null}
import requests

response = requests.get(
    "/api/v1/orders/twap/history?account=42trU9A5...&limit=100",
    headers={"Accept": "*/*"},
)

data = response.json()
```


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