---
title: "Funding rate"
description: "List a perpetual's past funding rates, newest first."
---

Pagination works as follows:

- We perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.
- The lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.
- If a `cursor` is provided, it will be used to fetch results from that point onwards.
- Pagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.

| | |
|---|---|
| SDK | `client.funding_rate(...)` |
| HTTP | `POST https://market-data.<domain>/full/v1/funding`, or `/lite/v1/funding` for [lite names](../../guides/environments.md#encoding-full-or-lite) (the SDKs' default) |
| WebSocket | method `v1/funding` on `wss://market-data.<domain>/ws/full`, or `/ws/lite` for lite names |
| Auth | None (public) |
| Retries | Read: the SDKs retry retryable errors ([rules](../../guides/errors-and-retries.md)) |
| Contract id | `settlement.funding_rate` (`RPCFundingRateV1`) |

## Request

Body type `ApiFundingRateRequest`. Fields the server fills are left out.

- `instrument` · lite `i` · string (instrument name) · required — The instrument name, e.g. `BTC_USDT_Perp` (perpetual), `BTC_USDT_SFP` (stable funding perp) or `BTC_USDT_SpotSwap` (spot swap).
- `start_time` · lite `st` · string (int64 unix ns) · optional, default `0` — Start time of funding rate in unix nanoseconds
- `end_time` · lite `et` · string (int64 unix ns) · optional, default `now()` — End time of funding rate in unix nanoseconds
- `limit` · lite `l` · integer (uint32) · optional, default `500` — The limit to query for. Defaults to 500; Max 1000
- `cursor` · lite `c` · string · optional — The cursor to indicate when to start the query from
- `agg_type` · lite `at` · enum FundingRateAggregationType · optional, default `FUNDING_INTERVAL` — Aggregation method for historical funding rate observations. Defaults to using the instrument-specific funding interval.
  Values: `FUNDING_INTERVAL`, `ONE_HOURLY`, `FOUR_HOURLY`, `EIGHT_HOURLY` ([details](../enums.md#fundingrateaggregationtype)).

## Response

Body type `ApiFundingRateResponse` (the same object is the JSON-RPC `result` over WebSocket).

- `result` · lite `r` · object ApiFundingRate[] · required — The funding rate result set for given interval
- `result[].instrument` · lite `i` · string (instrument name) · required — The instrument name, e.g. `BTC_USDT_Perp` (perpetual), `BTC_USDT_SFP` (stable funding perp) or `BTC_USDT_SpotSwap` (spot swap).
- `result[].funding_rate` · lite `fr` · string · optional — The funding rate of the instrument, expressed in percentage points. Absent for stable perps, which have `funding_rate_long_apr_pct` and `funding_rate_short_apr_pct` instead.
- `result[].funding_time` · lite `ft` · string (int64 unix ns) · required — The funding timestamp of the funding rate, expressed in unix nanoseconds
- `result[].mark_price` · lite `mp` · string · required — The mark price of the instrument at funding timestamp. Decimal string, e.g. "65000.5"; up to 9 decimals. For stable perps, the index price the charge used.
- `result[].funding_rate_8_h_avg` · lite `fr1` · string · optional — Deprecated: Refer to `funding_rate` instead. Will be removed in a future release. Absent for stable perps.
- `result[].funding_interval_hours` · lite `fi` · integer (uint8) · required — Funding interval in hours (e.g. 1/4/8/etc).
- `result[].funding_rate_long_apr_pct` · lite `fr2` · string · optional — Stable perps only: the annual rate for retail longs at this charge, in percent a year (`'-5.5'` = retail longs paid 5.5%; positive = retail receives, negative = retail pays). Absent for other kinds.
- `result[].funding_rate_short_apr_pct` · lite `fr3` · string · optional — Stable perps only: the annual rate for retail shorts at this charge, in percent a year (`'-5'` = retail shorts paid 5%; positive = retail receives, negative = retail pays). Absent for other kinds.
- `result[].funding_multiplier` · lite `fm` · integer (uint8) · optional — Stable perps only: days of funding the charge covered, 3 on the triple day, else 1. Absent for other kinds.
- `next` · lite `n` · string · optional — The cursor to indicate when to start the next query from

## Errors

Errors come back as `{"code", "message", "status"}` (lite `{"c", "m", "s"}`) with the HTTP status. Codes this call can return, as code, name (HTTP status) ([all error codes](../errors.md)):

`1002` InternalServer (500) · `1003` InvalidRequest (400) · `1006` RateLimit (429, retryable) · `1014` GatewayTimeout (504, retryable) · `1015` ServiceUnavailable (503, retryable) · `3007` NotApplicableForSpotInstrument (400) · `3008` InvalidFundingAggregationTypeForStablePerp (400) · `3012` InvalidCursor (400)

## Example

```python
from grvt import Grvt

with Grvt(env="testnet") as client:
    resp = client.funding_rate(
        instrument="BTC_USDT_Perp",
        limit=500,
    )
    print(resp)
```

Raw HTTP (set `GRVT_DOMAIN`, see [Environments](../../guides/environments.md)):

With full field names:

```sh
curl -sS "https://market-data.$GRVT_DOMAIN/full/v1/funding" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "instrument": "BTC_USDT_Perp",
  "limit": 500
}
EOF
```

With lite field names:

```sh
curl -sS "https://market-data.$GRVT_DOMAIN/lite/v1/funding" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "i": "BTC_USDT_Perp",
  "l": 500
}
EOF
```
