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

# Get Funding

`GET /api/v1/backtesting/funding`

## Request

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

Historical funding — the 5-minute rate snapshots (with OI / mark) or, with
``grain=hourly``, the settled hourly Hyperliquid payments.

Read ``grain`` on the response before aggregating: the default rows sample
the live hourly rate ~12 times per settlement, so summing them overstates
carry ~12x. The honest daily carry from the snapshot series is
``mean(funding_rate) x 24``; the exact figure is ``sum(funding_rate)`` over
the ``grain=hourly`` rows. ``coverage`` gives local retention for the
symbol; ``next_cursor`` / ``has_more`` page the window.

## Query parameters

- `symbol` string, required: Symbol, e.g. BTC or BTCUSDT
- `exchange` string: binance or hyperliquid
- `start` string, required: Start time (ISO 8601 or unix ms)
- `end` string: End time (ISO 8601 or unix ms, defaults to now). EXCLUSIVE — the range is [start, end), so consecutive windows do not repeat a boundary row.
- `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
- `grain` string: `snapshot_5m` (default): the LIVE rate sampled every 5 minutes, plus open interest and mark — a rate series, NOT payments; do not sum it. `hourly`: one row per settled Hyperliquid funding print (HL `fundingHistory`, the carry actually paid), with `premium`; hyperliquid only, filled daily for the previous UTC day.
- `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

- BacktestFundingResponse
  - `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
  - `symbol` string, required
  - `exchange` string, required
  - `count` integer, required
  - `data` BacktestFundingEntry[], required
    - `time` integer, required
    - `symbol` string, required
    - `exchange` string, required
    - `funding_rate` number, nullable
    - `open_interest` number, nullable
    - `mark_price` number, nullable
    - `premium` number, nullable

## 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)
