> ## Documentation Index
> Fetch the complete documentation index at: https://docs.struct.to/llms.txt
> Use this file to discover all available pages before exploring further.

# Asset Window Updates

> Stream crypto asset candle open and close events.

<Note>
  **Room ID:** `polymarket_asset_window_updates` \
  **Endpoint:** `wss://api.struct.to/ws` \
  **Rate:** 0.025 credits per message
</Note>

Stream candle open and close events for crypto assets. At least one of `asset_symbols` or `timeframes` is required.

<Tip>
  **Related guide:** [Crypto Up/Down feed](/guides/crypto-up-down-feed) uses this room for live window open and close resolutions.
</Tip>

## Subscribe

You must provide at least one filter. Specify the assets you want to track and the candle timeframes you are interested in.

### Filters

| Filter          | Type       | Required                     | Description                                                                                           |
| --------------- | ---------- | ---------------------------- | ----------------------------------------------------------------------------------------------------- |
| `asset_symbols` | `string[]` | At least one filter required | Asset symbols to track, e.g. `["BTC", "ETH"]`                                                         |
| `timeframes`    | `string[]` | At least one filter required | One or more of `5m`, `15m`, `1h`, `4h`, `1d`, `24h`                                                   |
| `subscribe_all` | `boolean`  | No                           | Firehose: receive every window update across all symbols and timeframes. Filters are ignored when set |

### Example

```json theme={null}
{
  "type": "join_room",
  "payload": {
    "room_id": "polymarket_asset_window_updates"
  }
}
```

```json theme={null}
{
  "type": "room_message",
  "payload": {
    "room_id": "polymarket_asset_window_updates",
    "message": {
      "action": "subscribe",
      "asset_symbols": ["BTC"],
      "timeframes": ["1h"]
    }
  }
}
```

### Response

```json theme={null}
{
  "type": "asset_window_updates_stream_subscribe_response",
  "room_id": "polymarket_asset_window_updates",
  "data": {
    "asset_symbols": ["BTC"],
    "timeframes": ["1h"]
  }
}
```

## Events

### `asset_price_window_update`

```json theme={null}
{
  "type": "asset_price_window_update",
  "room_id": "polymarket_asset_window_updates",
  "data": {
    "event_type": "window_update",
    "symbol": "BTC",
    "variant": "5m",
    "start_time": 1743499700000,
    "end_time": 1743500000000,
    "open_price": 97200.0,
    "close_price": 97250.50,
    "update_type": "open",
    "published_at": 1743500000000
  }
}
```
