# Running TWAPs stream | API reference | Femtos

> 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). WebSocket channel hc.twaps 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/ws/twaps

WebSocket: get a ticket (`POST https://api.femtos.xyz/v1/ws-ticket` with your key), connect to `wss://api.femtos.xyz/v1/ws?ticket=$TICKET`, send the frame below; the first message has `"snapshot": true`. Details: https://femtos.xyz/agents.md#websocket

## Running TWAPs stream — 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).

Layers: HyperCore. Not on Elysium or HyperEVM: a channel of HyperCore only.
Page with live calls: https://femtos.xyz/reference/ws/twaps?layer=hypercore

| Param | In | Example or values | Meaning |
|---|---|---|---|
| `coin` | filter | `BTC` | HyperCore market (BTC, @107, xyz:TSLA) |
| `user` | filter | (optional) | Account: 0x address or a named wallet's handle |
| `sort` | filter | `(empty)`, `remaining`, `newest`, `ending` | remaining (default), newest or ending |
| `limit` | filter | (optional) | TWAPs, default 200 (1..1000) |

```json
{"op":"subscribe","channel":"hc.twaps","filter":{"coin":"BTC"}}
```

| Field | Type | Meaning |
|---|---|---|
| `snapshot: true` | object | the full GET /v1/hypercore/twaps answer: the first frame, and any frame sent whole |
| `patch: true` | JsonPatch | with "patch": true on subscribe: the operations, in order, that turn the previous answer into this one |

## 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)
- [TWAP history](https://femtos.xyz/reference/twap-history.md) `GET /v1/hypercore/twaps/history`: Ended TWAPs of a market or an account, newest first: what executed, at what price, how they ended. (HyperCore)

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