# userTwapSummaries

{% hint style="info" %}
**All data fully available from 28-07-2025. We have performed a full backfill of all fills the HL native API offered, meaning that we have full historical data for most traders except for some very high volume addresses. TWAP fills are included from 02-08-2025.**
{% endhint %}

{% hint style="info" %}
💧New endpoint - this endpoint is not a part of original Hyperliquid API and is added by us for builder convenience.
{% endhint %}

Returns one summary per TWAP order for a user, aggregating all slice fills that share the same `twapId`. Includes the volume-weighted average price, total size, total fees, total closed PnL, number of slices, and the time range of execution.

## POST Request

<table><thead><tr><th width="161.9998779296875">Field</th><th width="119">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td>string</td><td>Must be <code>"userTwapSummaries"</code></td></tr><tr><td><code>user</code></td><td>string</td><td>Ethereum address (0x-prefixed, 42 characters)</td></tr></tbody></table>

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST https://api.hydromancer.xyz/info \
  -H "Authorization: Bearer $HYDROMANCER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "userTwapSummaries",
    "user": "0x0000000000000000000000000000000000000000"
  }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import os

response = requests.post(
    'https://api.hydromancer.xyz/info',
    json={
        'type': 'userTwapSummaries',
        'user': '0x0000000000000000000000000000000000000000'
    },
    headers={
        'Authorization': f'Bearer {os.environ.get("HYDROMANCER_API_KEY")}',
        'Content-Type': 'application/json'
    }
)

print(response.json())
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
import axios from 'axios';

try {
    const response = await axios.post('https://api.hydromancer.xyz/info', {
        type: 'userTwapSummaries',
        user: '0x0000000000000000000000000000000000000000'
    }, {
        headers: {
            'Authorization': `Bearer ${process.env.HYDROMANCER_API_KEY}`,
            'Content-Type': 'application/json'
        }
    });

    console.log(response.data);
} catch (error) {
    console.error('Error:', error.message);
}
```

{% endtab %}
{% endtabs %}

<details>

<summary>Response</summary>

{% hint style="warning" %}
**Number formatting:** Numeric fields (`avgPx`, `sz`, `fee`, `closedPnl`) are emitted in normalized form — trailing zeros are stripped and the decimal point is dropped for integers (e.g. `"0.054"` not `"0.05400"`, `"0"` not `"0.00"`). Compare values numerically, not by string equality.
{% endhint %}

```json
[
{
"user": "0x0000000000000000000000000000000000000000",
"twapId": 1628419,
"coin": "BTC",
"side": "A",
"avgPx": "67832.45",
"sz": "0.054",
"fee": "1.65115",
"closedPnl": "0",
"nSlices": 50,
"firstFillTime": 1772092668036,
"lastFillTime": 1772096268036
}
]
```

</details>

<details>

<summary>Response Fields</summary>

| Field           | Type   | Description                                          |
| --------------- | ------ | ---------------------------------------------------- |
| `user`          | string | User address                                         |
| `twapId`        | number | TWAP order identifier                                |
| `coin`          | string | Asset symbol (e.g. `"BTC"`)                          |
| `side`          | string | `"B"` for buy, `"A"` for sell                        |
| `avgPx`         | string | Volume-weighted average fill price across all slices |
| `sz`            | string | Total size filled across all slices                  |
| `fee`           | string | Total fees paid across all slices                    |
| `closedPnl`     | string | Total closed PnL across all slices                   |
| `nSlices`       | number | Number of individual slice fills executed            |
| `firstFillTime` | number | Timestamp (ms) of the first slice fill               |
| `lastFillTime`  | number | Timestamp (ms) of the last slice fill                |

</details>

<details>

<summary>Notes</summary>

* Returns at most 500 most recent TWAP summaries, ordered by last fill time descending
* Each summary aggregates all slice fills that share the same `twapId` — use `userTwapSliceFills` to get the individual fills
* `avgPx` is the volume-weighted average price: `sum(px * sz) / sum(sz)` across all slices
* Summaries update incrementally as new TWAP slices are executed

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hydromancer.xyz/readme/rest-api/historical-data/usertwapsummaries.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
