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

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

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

Returns every TWAP on the account that hasn't finished, as one list of records. The list merges two sources:

* TWAP orders, from [Create TWAP order](https://docs.pacifica.fi/api-documentation/api/rest-api/twap/create-twap-order.md). `identity.kind` is `order`.
* TWAP order strategies, from [Create order strategy](https://docs.pacifica.fi/api-documentation/api/rest-api/order-strategies/create-order-strategy.md) with `strategy_type` `twap`. `identity.kind` is `strategy`.

Records are sorted by creation time, newest first. Only TWAP orders created through the API are listed. A new TWAP order can take a moment to appear. For finished TWAPs, 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 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?account=42trU9A5...&limit=100
```

#### Response

* Status 200: Successfully retrieved TWAP records

```json theme={null}
{
  "success": true,
  "data": {
    "records": [
      {
        "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": "running",
        "terminal_reason": null,
        "created_at_ms": 1716200300000,
        "updated_at_ms": 1716200750000,
        "capabilities": ["cancel", "timeline"]
      },
      {
        "identity": {
          "kind": "order",
          "order_id": 13753364
        },
        "symbol": "BTC",
        "side": "bid",
        "initial_amount": "0.121000000000000000",
        "filled_amount": "0.040000000000000000",
        "average_fill_price": "87412.5",
        "reduce_only": false,
        "duration_seconds": 3630,
        "randomize": false,
        "slippage_percent": "0.500000000000",
        "price_limit": null,
        "number_of_clips": 121,
        "placed_clip_count": 40,
        "status": "running",
        "terminal_reason": null,
        "created_at_ms": 1716200000000,
        "updated_at_ms": 1716201200000,
        "capabilities": ["cancel"]
      }
    ],
    "next_cursor": null,
    "has_more": false
  },
  "error": null,
  "code": null
}
```

<table><thead><tr><th width="208">Field</th><th width="186">Type</th><th>Description</th></tr></thead><tbody><tr><td>`"identity"`</td><td>object</td><td>Where the TWAP comes from. `"kind"` is `"order"` or `"strategy"`. An order has `"order_id"` (integer). A strategy has `"strategy_id"` (UUID) and `"revision"` (integer)</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 TWAP 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</td></tr><tr><td>`"filled_amount"`</td><td>decimal string</td><td>Amount (in token denomination) filled so far</td></tr><tr><td>`"average_fill_price"`</td><td>decimal string or null</td><td>Average fill price. `null` if nothing has filled</td></tr><tr><td>`"reduce_only"`</td><td>boolean</td><td>If each slice is reduce only</td></tr><tr><td>`"duration_seconds"`</td><td>integer</td><td>For a strategy, the duration you set. For an order, the time from creation to `expiration`, which is about 30 seconds longer than `duration_in_seconds`</td></tr><tr><td>`"randomize"`</td><td>boolean</td><td>If slice sizes and timing are randomized. Always `false` for an order</td></tr><tr><td>`"slippage_percent"`</td><td>decimal string or null</td><td>Maximum slippage for each slice, in percent. `null` for a strategy that uses the default</td></tr><tr><td>`"price_limit"`</td><td>decimal string or null</td><td>Price limit of a strategy. Always `null` for an order</td></tr><tr><td>`"number_of_clips"`</td><td>integer</td><td>Number of planned slices. For an order, this is `planned_sub_order_count`</td></tr><tr><td>`"placed_clip_count"`</td><td>integer</td><td>Number of slices processed so far. For an order, this is `past_sub_order_count`</td></tr><tr><td>`"status"`</td><td>string</td><td>`"pending"`: a strategy waiting for its scheduled start\
`"active"`: an order with no slice processed yet, or an armed strategy that isn't placing slices yet\
`"running"`: placing slices\
`"paused"`: a strategy held by its price limit</td></tr><tr><td>`"terminal_reason"`</td><td>string or null</td><td>Always `null` here. See [Get TWAP record history](https://docs.pacifica.fi/api-documentation/api/rest-api/twap/get-twap-record-history.md)</td></tr><tr><td>`"created_at_ms"`</td><td>integer</td><td>Timestamp in milliseconds when the TWAP was created</td></tr><tr><td>`"updated_at_ms"`</td><td>integer</td><td>Timestamp in milliseconds when the TWAP was last updated</td></tr><tr><td>`"capabilities"`</td><td>array of strings</td><td>What you can do with the TWAP now:\
`"cancel"`: cancel an order with [Cancel TWAP order](https://docs.pacifica.fi/api-documentation/api/rest-api/twap/cancel-twap-order.md), or a strategy with [Cancel order strategy](https://docs.pacifica.fi/api-documentation/api/rest-api/order-strategies/cancel-order-strategy.md)\
`"edit"`: edit the strategy with [Edit order strategy](https://docs.pacifica.fi/api-documentation/api/rest-api/order-strategies/edit-order-strategy.md). Only before it starts placing orders, and not while paused\
`"timeline"`: get the strategy's events with [Get order strategy timeline](https://docs.pacifica.fi/api-documentation/api/rest-api/order-strategies/get-order-strategy-timeline.md)</td></tr><tr><td>`'next_cursor'`</td><td>string or null</td><td>Next cursor for pagination</td></tr><tr><td>`'has_more'`</td><td>boolean</td><td>True if there exists a `'next_cursor'`</td></tr></tbody></table>

Amounts and slippage of an order record keep their stored decimal places, for example `0.121000000000000000`.

* 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?account=42trU9A5...&limit=100",
    headers={"Accept": "*/*"},
)

data = response.json()
```


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