> ## 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 Record History

> This endpoint allows users to list an account's finished TWAPs, from both TWAP orders and TWAP order strategies.

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

Returns every finished TWAP on the account, as one list of records. Like [Get TWAP records](https://docs.pacifica.fi/api-documentation/api/rest-api/twap/get-twap-records.md), it merges TWAP orders (`identity.kind` is `order`) and TWAP order strategies (`identity.kind` is `strategy`).

Records are sorted by creation time, newest first. Only TWAP orders created through the API are listed.

#### 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 TWAPs</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 outside 1 to 500 are clamped to that range</td><td>`100`</td></tr><tr><td>`"cursor"`</td><td>string</td><td>optional</td><td>The `next_cursor` from the previous page. Default to none</td><td>`3vQB7B6M...`</td></tr></tbody></table>

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

#### Response

* Status 200: Successfully retrieved TWAP record history

```json theme={null}
{
  "success": true,
  "data": {
    "records": [
      {
        "identity": {
          "kind": "order",
          "order_id": 13753364
        },
        "symbol": "BTC",
        "side": "bid",
        "initial_amount": "0.121000000000000000",
        "filled_amount": "0.121000000000000000",
        "average_fill_price": "87398.2",
        "reduce_only": false,
        "duration_seconds": 3630,
        "randomize": false,
        "slippage_percent": "0.500000000000",
        "price_limit": null,
        "number_of_clips": 121,
        "placed_clip_count": 121,
        "status": "completed",
        "terminal_reason": null,
        "created_at_ms": 1716200000000,
        "updated_at_ms": 1716203600000,
        "capabilities": []
      },
      {
        "identity": {
          "kind": "strategy",
          "strategy_id": "0f8e7c2a-4b1d-4e5f-9a3b-2c1d0e9f8a7b",
          "revision": 1
        },
        "symbol": "ETH",
        "side": "ask",
        "initial_amount": "2",
        "filled_amount": "0.5",
        "average_fill_price": "3120.4",
        "reduce_only": false,
        "duration_seconds": 1800,
        "randomize": true,
        "slippage_percent": null,
        "price_limit": "3000",
        "number_of_clips": 61,
        "placed_clip_count": 15,
        "status": "cancelled",
        "terminal_reason": "user_cancel",
        "created_at_ms": 1716190000000,
        "updated_at_ms": 1716190460000,
        "capabilities": ["timeline"]
      }
    ],
    "next_cursor": "3vQB7B6M...",
    "has_more": true
  },
  "error": null,
  "code": null
}
```

The record fields match [Get TWAP records](https://docs.pacifica.fi/api-documentation/api/rest-api/twap/get-twap-records.md). These fields differ:

<table><thead><tr><th width="208">Field</th><th width="186">Type</th><th>Description</th></tr></thead><tbody><tr><td>`"status"`</td><td>string</td><td>`"completed"`: the TWAP finished. For an order, this means the full amount filled\
`"cancelled"`: cancelled, by you or by Pacifica\
`"expired"`: the TWAP ended early or unfilled. For an order, part of the amount was still unfilled when it ran out of planned sub-orders or time. For a strategy, it reached its expiry or scheduled end\
`"failed"`: the TWAP could not continue. For an order, the engine rejected a sub-order</td></tr><tr><td>`"terminal_reason"`</td><td>string or null</td><td>Why the TWAP stopped, when known, for example `"user_cancel"`, `"boundary_cancel"`, `"insufficient_balance"`, or `"rejected"`. For an order, `"user_cancel"` when `"cancelled"`, `"rejected"` when `"failed"`, and `null` otherwise</td></tr><tr><td>`"capabilities"`</td><td>array of strings</td><td>`["timeline"]` for a strategy. Empty for an order</td></tr></tbody></table>

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

#### Code Example (Python)

```python theme={null}
import requests

response = requests.get(
    "/api/v1/twaps/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.