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

# Funding Rates

> Query perpetual funding rates with client.funding_rates()

Use `client.funding_rates()` when you need historical funding rate data for perpetual contracts. This method returns a time series of funding rates used for carry modeling and perpetual trading analysis.

## Method signature

```python theme={null}
funding_rates(source, market, from_, to, limit=1000)
```

## Parameters

| Parameter | Type                  | Required | Notes                                                                  |
| --------- | --------------------- | -------- | ---------------------------------------------------------------------- |
| source    | str                   | Yes      | Source ID                                                              |
| market    | str                   | Yes      | Normalized market or instrument ID                                     |
| from\_    | str/datetime/date/int | Yes      | Inclusive start time (ISO 8601, datetime, date, or epoch microseconds) |
| to        | str/datetime/date/int | Yes      | Exclusive end time (same formats as from\_)                            |
| limit     | int                   | No       | Page size (default: 1000)                                              |

**Note:** API key required for historical ranges. Set `POLARIS_API_KEY` environment variable or pass `api_key` to `PolarisClient()`.

## Return value

List of funding rate point series rows.

## Example response

```python theme={null}
[
    {
        'timestamp': 1704067200000000,
        'venue': 'binance',
        'symbol': 'BTCUSDT',
        'funding_rate': 0.00017,
        'funding_interval': 8 * 3600  # seconds
    }
]
```

## Fields

Funding rate records include:

* `timestamp`: observation time in UTC microseconds since the Unix epoch
* `venue`: exchange identifier
* `symbol`: normalized instrument symbol
* `funding_rate`: the funding rate (decimal, e.g., 0.00017 = 0.017%)
* `funding_interval`: funding period in seconds (typically 1h, 4h, or 8h)

## Example

```python theme={null}
from datetime import datetime, timedelta, timezone
from polaris_data import PolarisClient

end = datetime.now(timezone.utc)
start = end - timedelta(days=7)

with PolarisClient() as client:
    rates = client.funding_rates(
        source="binance",
        market="BTCUSDT",
        from_=start,
        to=end,
    )

print(rates[:2])
```

## How it works

`client.funding_rates()` uses snapshot-first replay: it queries the `/snapshots` endpoint for historical data and reads from local cached files when available. Funding rates are extracted from standardized datapoint events with the `funding_rate` label.

For more details on snapshot-based queries, see [Snapshots](/reference/snapshots).

## Related documentation

* [Mark prices](/sdks/mark-prices) for related perpetual contract metrics
* [Events](/sdks/events) if you need funding rates mixed with other datapoints
* [Authentication](/guides/authentication)
