# TWAP history | API reference | Femtos

> Ended TWAPs of a market or an account, newest first: what executed, at what price, how they ended. GET /v1/hypercore/twaps/history on HyperCore: parameters, response fields and a live call per layer.

- Base URL: `https://api.femtos.xyz/v1` (REST) · `wss://api.femtos.xyz/v1/ws` (WebSocket) · MCP: `https://api.femtos.xyz/mcp`
- Auth: `Authorization: Bearer $FEMTOS_KEY`. Free key: https://dashboard.femtos.xyz/signup (browser), or with
  no browser: `GET https://femtos.xyz/accounts/agent/challenge`, solve its proof of work, then `POST https://femtos.xyz/accounts/agent/signup`
  (https://femtos.xyz/agents.md#agent-onboarding)
- Decimals are exact strings, times Unix milliseconds, addresses lowercase `0x`
- Whole API in one file: https://femtos.xyz/agents.md · OpenAPI: https://api.femtos.xyz/v1/openapi.json · Index: https://femtos.xyz/llms.txt
- Page with live calls: https://femtos.xyz/reference/twap-history

## TWAP history — GET `/v1/hypercore/twaps/history`

Ended TWAPs of a market or an account, newest first: what executed, at what price, how they ended.

Layers: HyperCore. Not on Elysium or HyperEVM: served on HyperCore only.
Page with live calls: https://femtos.xyz/reference/twap-history?layer=hypercore

| Param | In | Example or values | Meaning |
|---|---|---|---|
| `coin` | query | `BTC` | Market (perp name, spot @index, HIP-3 dex:COIN); every market when absent |
| `user` | query | (optional) | Only this account |
| `status` | query | `(empty)`, `finished`, `terminated`, `error` | One way of ending; every one when absent |
| `from` | query | (optional) | Window start (Unix ms, default `to` − 24 h) |
| `to` | query | (optional) | Window end (Unix ms, exclusive, default now) |
| `limit` | query | `50` | TWAPs |

```bash
curl -H "Authorization: Bearer $FEMTOS_KEY" "https://api.femtos.xyz/v1/hypercore/twaps/history?coin=BTC&limit=50"
```

| Field | Type | Meaning |
|---|---|---|
| `twaps[]` | object | Newest end first: {twapId, user, entity, coin, side, status, description, sz, executedSz, executedNtl, avgPx, remainingSz, …} |
| `twaps[].status` | activated \| waitingForTrigger \| finished \| terminated \| stopped \| error | Its last status: activated (running), waitingForTrigger, or how it ended |
| `twaps[].description` | string \| null | Why it stopped, for `error` (Hyperliquid's text, e.g. "Insufficient margin to place order."); null otherwise |
| `twaps[].executedNtl` | decimal | Notional executed so far: Σ px × sz of its slices (quote units, USDC on the main dex) |
| `twaps[].avgPx` | decimal \| null | executedNtl ÷ executedSz (40 significant digits when it does not terminate); null before its first slice |
| `twaps[].endedAt` | int \| null | When it ended (Unix ms, the block of its end status); null while it runs |
| `from` | ms | Start of the window read |
| `to` | ms | End of the window read (exclusive) |
| `next_cursor` | string \| null | Opaque cursor of the next page: pass it as `cursor`, unchanged. null on the last page |

Next page: `cursor` = the `next_cursor` of the previous answer (https://femtos.xyz/agents.md#pagination).

## Related (TWAPs)

- [Running TWAPs](https://femtos.xyz/reference/twaps.md) `GET /v1/hypercore/twaps`: Running TWAPs of a market or an account with their progress, and the net TWAP pressure per market. (HyperCore)
- [Running TWAPs stream](https://femtos.xyz/reference/ws/twaps.md) `WS hc.twaps`: The GET /v1/hypercore/twaps answer (running TWAPs, their progress, the net TWAP pressure) of a market or an account, pushed on subscribe, then when one of its TWAPs starts, fills a slice or ends (whole, or as a JSON Patch). (HyperCore)

Every page: https://femtos.xyz/reference.md
