# OHLCV Data - Aggregated Candlestick Data

Pre-aggregated candlestick data (Open, High, Low, Close, Volume), also called klines, for Hyperliquid markets, served from a Dwellir endpoint (API key required) over REST, JSON-RPC, and WebSocket. Intervals are `1s`, `1m` (1-minute klines), and `5m`, and history starts on `2025-07-27`. Range queries return up to 5,000 candles per call.

## What is OHLCV Data?

OHLCV data aggregates individual fills into time-based candles that are easier to use for charting, technical analysis, portfolio monitoring, and strategy backtesting than raw execution streams.

This product is built from the same raw fill data Dwellir collects from Hyperliquid and stores canonically, then derives sparse `1s`, `1m`, and `5m` candles from that trade history.

The OHLCV endpoint is available now at `api-hyperliquid-index.n.dwellir.com`. It requires a Dwellir API key, the same key model used
across the platform.

The OHLCV archive starts at `2025-07-27T08:00:00Z`, which matches the first available `node_fills_by_block` archive entry. The backfill
is complete, so `1s`, `1m`, and `5m` candles are available from that point to the present. Candles are sparse: intervals with no trades have no candle.

## Available Intervals

| Interval | Description | Typical Use Case                                 |
| -------- | ----------- | ------------------------------------------------ |
| `1s`     | 1 second    | High-frequency analysis, microstructure research |
| `1m`     | 1 minute    | Intraday trading, execution review, dashboards   |
| `5m`     | 5 minutes   | Short-term trend analysis, higher-level charting |

Larger intervals are intentionally not materialized today. Clients can derive them from the shipped `1s`, `1m`, or `5m` candles.

## Available Markets

OHLCV data covers all Hyperliquid market types. Each type uses a different symbol format in the `market` parameter:

| Market type       | Symbol format  | Example                | How it works                                     |
| ----------------- | -------------- | ---------------------- | ------------------------------------------------ |
| **Perp** (native) | `ASSET`        | `BTC`, `ETH`, `SOL`    | Use the asset name directly                      |
| **Spot**          | `@INDEX`       | `@142`, `@1`, `@9`     | Use `@` followed by the pair's numeric index     |
| **HIP-3 perpDex** | `prefix:ASSET` | `hyna:ETH`, `xyz:AAPL` | Use the DEX prefix, a colon, then the asset name |

Spot markets use the `@INDEX` format (e.g. `@142` for UBTC/USDC), **not** the token name. The only exception is `PURR`, the sole canonical spot pair, which can be queried by name.

### Discovering market symbols

Use Dwellir's [Info Endpoint](https://www.dwellir.com/docs/hyperliquid/info-endpoint) to look up valid symbols before querying candles.

| Market type       | Info Endpoint                                           | What to look for                                                            |
| ----------------- | ------------------------------------------------------- | --------------------------------------------------------------------------- |
| **Perp**          | [`meta`](https://www.dwellir.com/docs/hyperliquid/meta)          | Each entry's `name` field in the `universe` array (e.g. `"BTC"`)            |
| **Spot**          | [`spotMeta`](https://www.dwellir.com/docs/hyperliquid/spot-meta) | Each pair's `index` in the `universe` array — use as `@INDEX` (e.g. `@142`) |
| **HIP-3 perpDex** | [`perpDexs`](https://www.dwellir.com/docs/hyperliquid/perp-dexs) | The first element of each `assetToStreamingOiCap` pair (e.g. `"hyna:ETH"`)  |

For full details on how to query these endpoints, see [Discovering Markets](https://www.dwellir.com/docs/hyperliquid/hyperliquid-index/ohlcv-data/candles#discovering-markets) in the `candles` docs.

If you need to map a market to the underlying Hyperliquid asset index, start from [`meta`](https://www.dwellir.com/docs/hyperliquid/meta), [`spotMeta`](https://www.dwellir.com/docs/hyperliquid/spot-meta), and [`perpDexs`](https://www.dwellir.com/docs/hyperliquid/perp-dexs).

## Candle Schema

```text
s, i, t, T, o, h, l, c, v, q, n, x
```

| Field | Type           | Description                                                         |
| ----- | -------------- | ------------------------------------------------------------------- |
| `s`   | string         | Hyperliquid market symbol, for example `BTC`, `@142`, or `hyna:ETH` |
| `i`   | string         | Candle interval, one of `1s`, `1m`, `5m`                            |
| `t`   | integer        | Candle open time in Unix milliseconds                               |
| `T`   | integer        | Candle close time in Unix milliseconds                              |
| `o`   | decimal string | First trade price in interval                                       |
| `h`   | decimal string | Highest trade price in interval                                     |
| `l`   | decimal string | Lowest trade price in interval                                      |
| `c`   | decimal string | Last trade price in interval                                        |
| `v`   | decimal string | Total traded size in base units                                     |
| `q`   | decimal string | Total traded notional in quote units                                |
| `n`   | integer        | Number of contributing trades                                       |
| `x`   | boolean        | `true` when the candle is finalized, `false` when it is still open  |

## How to Use the Endpoint

Choose the transport that matches your workflow:

- [`candles`](https://www.dwellir.com/docs/hyperliquid/hyperliquid-index/ohlcv-data/candles) for single-market REST lookups, JSON-RPC lookups, and WebSocket live updates
- [`candle ranges`](https://www.dwellir.com/docs/hyperliquid/hyperliquid-index/ohlcv-data/candle-ranges) for paginated historical pulls of one market and interval
- [`allCandles`](https://www.dwellir.com/docs/hyperliquid/hyperliquid-index/ohlcv-data/all-candles) for one live stream of changed candles across active markets
- [Full-History Exports](https://www.dwellir.com/docs/hyperliquid/hyperliquid-index/ohlcv-data/full-history-exports) for ready-made CSV or Parquet files of the full archive for one market and interval
- [Archive backfill guide](https://www.dwellir.com/guides/hyperliquid-ohlcv-archive-backfill) for DIY historical retrieval of one market and one interval
- [CSV and Parquet export guide](https://www.dwellir.com/guides/hyperliquid-ohlcv-csv-export) for DIY flat-file or columnar exports by market and interval

Current product contract:

- REST returns one candle per request
- JSON-RPC returns one candle per request
- candle range REST and JSON-RPC endpoints return paginated `data` arrays and bill by the number of candle objects returned
- WebSocket streams live candle state after subscribe with `wss://api-hyperliquid-index.n.dwellir.com/YOUR_API_KEY`; `wss://api-hyperliquid-index.n.dwellir.com/YOUR_API_KEY/ws` is also accepted
- `allCandles` WebSocket streams emit arrays of changed candle snapshots and bill by the number of candle objects delivered in each data frame

## Sparse Candles

Only intervals with trading activity are materialized. Empty intervals are omitted rather than emitted as zero-volume carry-forward
candles.

This means:

- the dataset preserves real trading activity instead of synthesizing flat bars
- downstream consumers that need dense chart series can fill missing intervals on their side
- response counting for historical retrieval should assume one response per existing candle, not one response per theoretical time bucket

## Worked Example: 3 Months of 1-Minute Candles for One Market

Pulling 3 months (90 days) of `1m` candles for one market, for example BTC, looks like this:

- **Candles**: at most `90 x 1,440 = 129,600`. Candles are sparse, so a market with quiet minutes returns fewer.
- **Calls**: about `26` [candle range](https://www.dwellir.com/docs/hyperliquid/hyperliquid-index/ohlcv-data/candle-ranges) calls at `limit=5000`, following `nextCursor` until `hasMore` is `false`.
- **API credits**: range pages bill 1 credit per returned candle, so at most `129,600` credits. On the Developer plan's 25 million included responses, that is about 0.5% of the monthly allowance.

The official Hyperliquid `candleSnapshot` info request only returns the most recent 5,000 candles, which is about 3.5 days of `1m` candles. Dwellir range queries page back to `2025-07-27`.

To get the same 3 months as one file instead, a [full-history export](https://www.dwellir.com/docs/hyperliquid/hyperliquid-index/ohlcv-data/full-history-exports) returns the whole archive for one market and interval for 1 export credit.

## Rate Limits

Dwellir API plans set these rate limits, measured in responses per second. See [Rate Limits](https://www.dwellir.com/docs/getting-started/rate-limits) for burst behavior and handling `429` errors.

| Plan                  | Responses per second | Burst  |
| --------------------- | -------------------- | ------ |
| Free                  | 20                   | None   |
| Developer ($49/month) | 100                  | 500    |
| Growth ($299/month)   | 500                  | 2,500  |
| Scale ($999/month)    | 5,000                | 10,000 |

See [pricing](https://www.dwellir.com/pricing) for included responses and overage rates per plan.

## Response Volume for One Market Over 30 Days

Single-candle REST and JSON-RPC requests return one candle per response. For large historical windows, use candle ranges so each page can include up to `5000` returned candle objects while billing still counts the candle objects in `data`.

| Interval | Approximate candles in 30 days | Single-candle responses | Range pages at limit `5000` |
| -------- | ------------------------------ | ----------------------- | --------------------------- |
| `1s`     | `2,592,000`                    | `2,592,000`             | about `519` pages           |
| `1m`     | `43,200`                       | `43,200`                | about `9` pages             |
| `5m`     | `8,640`                        | `8,640`                 | about `2` pages             |

Sparse gaps lower the actual returned candle count and therefore lower the billable weight.

## Example Candle

```json
{
  "s": "BTC",
  "i": "1m",
  "t": 1774911600000,
  "T": 1774911659999,
  "o": "66745",
  "h": "66746",
  "l": "66687",
  "c": "66687",
  "v": "4.78586",
  "q": "319316.665",
  "n": 256,
  "x": true
}
```

## Data Quality

- **Accuracy**: Derived from canonical raw fill history
- **Consistency**: One schema across all shipped intervals and transports
- **Recency**: Historical backfill plus live candle upkeep

### Note on Sweep Executions

In fast markets, one large order can trade through several price levels in a single sweep. When candles are derived from raw fill data, those exact match prices are preserved, which can occasionally produce slightly different highs or lows than a venue's own public candlestick feed.

Think of the book like this:

- ask at `69344`
- ask at `69343`
- then one aggressive order arrives and buys through both levels

In one BTC 5-minute bar we validated, that sweep matched:

- `0.08487 BTC` at `69344`
- `0.34059 BTC` at `69343`

If you keep the exact fill prices, the candle for that slice is:

- `low = 69343`
- `volume = 0.42546 BTC`

From our benchmarking against the public Hyperliquid endpoint, it appears that their candlestick feed compresses some sweeps differently. We base our candles directly on node fills and preserve the executed prices instead of re-aggregating that move away, so the same sweep can appear as:

- `low = 69344`
- `volume = 0.42546 BTC`

This is intentional. Dwellir candles are built from the underlying node fill stream, so highs, lows, and volume reflect the executed prices we observe rather than a more compressed candle representation. That can produce small high or low differences versus another public feed, but it is the more execution-faithful view of what actually traded.

## Related Data Products

| Need                                      | Recommendation                                           |
| ----------------------------------------- | -------------------------------------------------------- |
| Individual trade executions               | [Tick Data](https://www.dwellir.com/docs/hyperliquid/tick-data) |
| Raw archive / full historical source data | [Historical Data](https://www.dwellir.com/docs/hyperliquid/historical-data)     |
| Native Hyperliquid L1 fill streaming      | [StreamFills gRPC](https://www.dwellir.com/docs/hyperliquid/stream_fills)  |

## Access

Use your Dwellir API key directly against the OHLCV host for live candle lookups and WebSocket streams. For historical OHLCV exports covering all markets with full archive depth, use the dashboard export feature.

- **[Sign up](https://dashboard.dwellir.com/register)** at the dashboard, then visit the **[OHLCV Data tab](https://dashboard.dwellir.com/hyperliquid?tab=ohlcv)** to buy export credits and generate CSV or Parquet files for any market at 1s, 1m, or 5m intervals.
- Pricing: [dwellir.com/pricing](https://www.dwellir.com/pricing). API plans start at $49/month (Developer), and 1 response = 1 API credit.
