# Aggregated Futures Funding Rate

## Definition

The average funding rate weighted by open interest from futures markets converted to a specified time period.

<table><thead><tr><th width="192">Name</th><th width="469">MetricID</th><th>Unit</th><th>Interval</th></tr></thead><tbody><tr><td>Funding rate, aggregated, futures, USD-margined, 8 hours</td><td><a href="https://coverage.coinmetrics.io/search-results?query=futures_aggregate_funding_rate_usd_margin_8h_period">futures_aggregate_funding_rate_usd_margin_8h_period</a></td><td>Dimensionless</td><td>1 hour</td></tr><tr><td>Funding rate, aggregated, futures, USD-margined, 1 day</td><td><a href="https://coverage.coinmetrics.io/search-results?query=futures_aggregate_funding_rate_usd_margin_1d_period">futures_aggregate_funding_rate_usd_margin_1d_period</a></td><td>Dimensionless</td><td>1 hour</td></tr><tr><td>Funding rate, aggregated, futures, USD-margined, 30 days</td><td><a href="https://coverage.coinmetrics.io/search-results?query=futures_aggregate_funding_rate_usd_margin_30d_period">futures_aggregate_funding_rate_usd_margin_30d_period</a></td><td>Dimensionless</td><td>1 hour</td></tr><tr><td>Funding rate, aggregated, futures, USD-margined, 1 year</td><td><a href="https://coverage.coinmetrics.io/search-results?query=futures_aggregate_funding_rate_usd_margin_1y_period">futures_aggregate_funding_rate_usd_margin_1y_period</a></td><td>Dimensionless</td><td>1 hour</td></tr><tr><td>Funding rate, aggregated, futures, coin-margined, 8 hours</td><td><a href="https://coverage.coinmetrics.io/search-results?query=futures_aggregate_funding_rate_coin_margin_8h_period">futures_aggregate_funding_rate_coin_margin_8h_period</a></td><td>Dimensionless</td><td>1 hour</td></tr><tr><td>Funding rate, aggregated, futures, coin-margined, 1 day</td><td><a href="https://coverage.coinmetrics.io/search-results?query=futures_aggregate_funding_rate_coin_margin_1d_period">futures_aggregate_funding_rate_coin_margin_1d_period</a></td><td>Dimensionless</td><td>1 hour</td></tr><tr><td>Funding rate, aggregated, futures, coin-margined, 30 days</td><td><a href="https://coverage.coinmetrics.io/search-results?query=futures_aggregate_funding_rate_coin_margin_30d_period">futures_aggregate_funding_rate_coin_margin_30d_period</a></td><td>Dimensionless</td><td>1 hour</td></tr><tr><td>Funding rate, aggregated, futures, coin-margined, 1 year</td><td><a href="https://coverage.coinmetrics.io/search-results?query=futures_aggregate_funding_rate_coin_margin_1y_period">futures_aggregate_funding_rate_coin_margin_1y_period</a></td><td>Dimensionless</td><td>1 hour</td></tr><tr><td>Funding rate, aggregated, futures, all-margined, 8 hours</td><td><a href="https://coverage.coinmetrics.io/search-results?query=futures_aggregate_funding_rate_all_margin_8h_period">futures_aggregate_funding_rate_all_margin_8h_period</a></td><td>Dimensionless</td><td>1 hour</td></tr><tr><td>Funding rate, aggregated, futures, all-margined, 1 day</td><td><a href="https://coverage.coinmetrics.io/search-results?query=futures_aggregate_funding_rate_all_margin_1d_period">futures_aggregate_funding_rate_all_margin_1d_period</a></td><td>Dimensionless</td><td>1 hour</td></tr><tr><td>Funding rate, aggregated, futures, all-margined, 30 days</td><td><a href="https://coverage.coinmetrics.io/search-results?query=futures_aggregate_funding_rate_all_margin_30d_period">futures_aggregate_funding_rate_all_margin_30d_period</a></td><td>Dimensionless</td><td>1 hour</td></tr><tr><td>Funding rate, aggregated, futures, all-margined, 1 year</td><td><a href="https://coverage.coinmetrics.io/search-results?query=futures_aggregate_funding_rate_all_margin_1y_period">futures_aggregate_funding_rate_all_margin_1y_period</a></td><td>Dimensionless</td><td>1 hour</td></tr></tbody></table>

## Details

The `futures_aggregate_funding_rate_usd_margin_*` metrics represent the average funding rate weighted by open interest from perpetual futures markets where the margin asset is U.S. dollars or stablecoins converted to a specified time period.

The `futures_aggregate_funding_rate_coin_margin_*` metrics represent the average funding rate weighted by open interest from perpetual futures markets where the margin asset is equivalent to the underlying base asset converted to a specified period.

The `futures_aggregate_funding_rate_all_margin_*` metrics represent the average funding rate weighted by open interest from all perpetual futures markets, regardless of the margin asset, converted to a specified time period.

These metrics have a publication frequency of once per hour and represent the average funding rate converted to 8 hour, 1 day, 30 day, and 1 year time periods.

Most, but not all, exchanges pay out the funding rate every 8 hours. Thus, standardizing the funding rate period is a step needed for each of the calculation of the funding rate metrics. For a funding rate $$FR$$ with an period $$P$$, expressed in hours, the 8-hour funding rate $$FR\_{8}$$ is calculated as follows:

$$
FR\_{8} = \frac{P}{8} FR
$$

For a list of markets $$X$$, where each market $$m$$ has funding rate $$FR\_{m}$$ and open interest $$OI\_{m}$$ converted to U.S. dollars, the aggregate funding rate $$AFR\_{X}$$ is calculated as:

$$
AFR\_{x} = \frac{\sum\_{m \in X} OI\_{m} FR\_{m,8}}{\sum\_{m \in X} OI\_{m}}
$$

## **API Endpoints**

Aggregate Futures Funding Rates can be accessed using the `timeseries/asset-metrics` and `timeseries/exchange-asset-metrics` endpoints by passing in `futures_aggregate_funding_rate_usd_margin_*` to the `metrics` parameter.

{% openapi src="<https://2398817338-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MO23j33wWGzm0NrZseN%2Fuploads%2Fgit-blob-1522f16027d90845f8750dd9c51c03b8e7aab67f%2Fopenapi.yaml?alt=media>" path="/timeseries/asset-metrics" method="get" %}
[openapi.yaml](https://2398817338-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MO23j33wWGzm0NrZseN%2Fuploads%2Fgit-blob-1522f16027d90845f8750dd9c51c03b8e7aab67f%2Fopenapi.yaml?alt=media)
{% endopenapi %}

{% tabs %}
{% tab title="Shell" %}

```shell
curl --compressed "https://api.coinmetrics.io/v4/timeseries/asset-metrics?assets=btc&metrics=futures_aggregate_funding_rate_usd_margin_8h_period&limit_per_asset=1&api_key=<your_key>"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
response = requests.get('https://api.coinmetrics.io/v4/timeseries/asset-metrics?assets=btc&metrics=futures_aggregate_funding_rate_usd_margin_8h_period&limit_per_asset=1&api_key=<your_key>
print(response)
```

{% endtab %}

{% tab title="Python Client" %}

```python
from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

print(
    client.get_asset_metrics(
        assets=["btc"], metrics=['futures_aggregate_funding_rate_usd_margin_8h_period'], frequency='1d', limit_per_market=1
    ).to_dataframe()
)
```

{% endtab %}
{% endtabs %}

{% openapi src="<https://2398817338-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MO23j33wWGzm0NrZseN%2Fuploads%2Fgit-blob-1522f16027d90845f8750dd9c51c03b8e7aab67f%2Fopenapi.yaml?alt=media>" path="/timeseries/exchange-asset-metrics" method="get" %}
[openapi.yaml](https://2398817338-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MO23j33wWGzm0NrZseN%2Fuploads%2Fgit-blob-1522f16027d90845f8750dd9c51c03b8e7aab67f%2Fopenapi.yaml?alt=media)
{% endopenapi %}

{% tabs %}
{% tab title="Shell" %}

```shell
curl --compressed "https://api.coinmetrics.io/v4/timeseries/exchange-asset-metrics?exchange_assets=binance-btc&metrics=futures_aggregate_funding_rate_usd_margin_8h_period&limit_per_exchange_asset=1&api_key=<your_key>"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
response = requests.get('https://api.coinmetrics.io/v4/timeseries/exchange-asset-metrics?exchange_assets=binance-btc&metrics=futures_aggregate_funding_rate_usd_margin_8h_period&limit_per_exchange_asset=1&api_key=<your_key>
print(response)
```

{% endtab %}

{% tab title="Python Client" %}

```python
from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

print(
    client.get_exchange_asset_metrics(
        exchanges=["binance-btc"], metrics=['futures_aggregate_funding_rate_usd_margin_8h_period'], frequency='1d', limit_per_market=1
    ).to_dataframe()
)
```

{% endtab %}
{% endtabs %}

## Example

```
{
  "data" : [ {
    "asset" : "btc",
    "time" : "2023-09-19T19:00:00.000000000Z",
    "futures_aggregate_funding_rate_all_margin_8h_period](https://coverage.coinmetrics.io/search-results?query=)" : "0.0000301358130541726"
  }, {
    "asset" : "btc",
    "time" : "2023-09-19T20:00:00.000000000Z",
    "futures_aggregate_funding_rate_all_margin_8h_period](https://coverage.coinmetrics.io/search-results?query=)" : "0.0000305589276681095"
  }, {
    "asset" : "btc",
    "time" : "2023-09-19T21:00:00.000000000Z",
    "futures_aggregate_funding_rate_all_margin_8h_period](https://coverage.coinmetrics.io/search-results?query=)" : "0.0000327674045704149"
  }, {
    "asset" : "btc",
    "time" : "2023-09-19T22:00:00.000000000Z",
    "futures_aggregate_funding_rate_all_margin_8h_period](https://coverage.coinmetrics.io/search-results?query=)" : "0.0000328893535861447"
  }, {
    "asset" : "btc",
    "time" : "2023-09-19T23:00:00.000000000Z",
    "futures_aggregate_funding_rate_all_margin_8h_period](https://coverage.coinmetrics.io/search-results?query=)" : "0.0000328738735624742"
  } ]
}
```

* **`asset`**: The id of the asset.\\
* **`time`**: The exchange-reported time in ISO 8601 date-time format. Always with nanoseconds precision.\\
* **`futures_aggregate_funding_rate_all_margin_8h_period`**: The weighted-average funding rate.

## Release History

* Released on September 19, 2023

## Availability for Assets

{% embed url="<https://coverage.coinmetrics.io/asset-metrics-v2/futures_aggregate_funding_rate_usd_margin_8h_period>" %}
