---
title: "Get Hl Funding Bars"
method: GET
path: "/api/v1/backtesting/hl-funding-bars"
tags: ["Backtesting"]
---

# Get Hl Funding Bars

`GET /api/v1/backtesting/hl-funding-bars`

## Request

- Base URL: `https://cryptodataapi.com`
- URL: `https://cryptodataapi.com/api/v1/backtesting/hl-funding-bars`
- Auth: API key in header `X-API-Key`

Hyperliquid funding and open interest aligned to the candle clock — one
row per closed bar per coin, so a funding/OI condition can be tested against
the same 4h bar a price signal fires on.

``time`` is the bar open and equals the ``timestamp`` of the matching
``/hyperliquid/candles`` bar (join on it). Per bar: ``funding_sum`` (carry
actually settled in ``(time, time + interval]`` — a settlement at 16:00 pays
for the hour before it, so it belongs to the bar that closes at 16:00) with
``n_settlements``; ``funding_rate_mean`` (mean live hourly rate over the
bar); ``oi_open`` / ``oi_close`` / ``oi_change_pct`` (base-coin units, first
and last 5-min sample in the bar) and ``mark_close``.

Point-in-time: every value was observable by the bar's close — act on it at
the NEXT bar's open. Bars start where our 5-min snapshots do (2026-03-30;
see ``coverage``) — Hyperliquid publishes no historical OI, so nothing
earlier can exist; older settled funding alone is ``/backtesting/funding?
grain=hourly``. ``funding_sum`` is null for the most recent day until its
prints are archived. Window ≤ 93 days per call. Pro Plus.

## Query parameters

- `coin` string, required: One HL coin name (BTC, kPEPE) or a comma list (up to 25; every value rides the index).
- `interval` string: Bar width: 1h, 4h or 1d — the same UTC grid as /hyperliquid/candles
- `start` string, required: Start time (ISO 8601 or unix ms); floored to the interval
- `end` string: End time (ISO 8601 or unix ms, defaults to now); floored to the interval, EXCLUSIVE
- `bounds` string: Interval convention for `start`/`end`. `half-open` (default) is [start, end) — `end` is EXCLUSIVE, so consecutive windows tile without repeating a boundary row. `closed` is [start, end] — `end` INCLUSIVE, the pre-2026-08-08 behaviour; use it only to keep an existing integration byte-identical.
- `limit` integer
- `cursor` string, nullable: Opaque page cursor — the `next_cursor` of the previous response, verbatim. Resumes strictly after the last row served, keyed on the table's full primary key, so a page boundary inside a same-millisecond burst loses nothing (unlike `start = last.time + 1`). `start` / `end` still bound the window.
- `format` string: json or csv. CSV has no envelope: paging state travels in the `X-Has-More` / `X-Next-Cursor` response headers.

## Response `200`

Successful Response

- BacktestHLFundingBarsResponse
  - `grain` GrainDescriptor: What ONE ROW of a series is, stated on the payload so it cannot be mis-summed. ``kind``: ``event`` (one fill), ``bar`` (a closed bucket), ``rate_snapshot`` (the live rate sampled on a timer), ``rolling_window`` (a trailing total sampled on a timer), ``settled_payment`` (one settlement print). ``sum_ok`` — adding rows across time is meaningful. ``is_cumulative`` — a row already contains its predecessors' flow. ``settlements_per_day`` is set for funding series only.
    - `kind` string, required
    - `cadence` string, nullable
    - `is_cumulative` boolean
    - `sum_ok` boolean
    - `window` string, nullable
    - `settlements_per_day` integer, nullable
    - `note` string, required
  - `coverage` CoverageInfo: Local retention bounds (ms) for the queried scope. ``archive_hint`` is set when the window starts before ``local_first`` — those rows are not missing, they live in the daily Parquet archive.
    - `local_first` integer, nullable
    - `local_last` integer, nullable
    - `archive_hint` string, nullable
  - `next_cursor` string, nullable
  - `has_more` boolean
  - `coin` string, required
  - `interval` string, required
  - `count` integer, required
  - `data` BacktestHLFundingBar[], required
    - `time` integer, required
    - `coin` string, required
    - `funding_sum` number, nullable
    - `n_settlements` integer
    - `funding_rate_mean` number, nullable
    - `oi_open` number, nullable
    - `oi_close` number, nullable
    - `oi_change_pct` number, nullable
    - `mark_close` number, nullable
    - `n_snapshots` integer
  - `join` object, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/cryptodataapi/apis/crypto-data-api.md) · [All operations](https://skmtc.dev/cryptodataapi/apis/crypto-data-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cryptodataapi/apis/crypto-data-api/revisions/8628b754ca81?raw)
