OPEN-SOURCE SCRIPT
Mis à jour

Binance Funding Rates [vichtoreb]

424
Source: binance.com/en/support/faq/detail/360033525031

The funding rate has two components: the interest rate and the average Premium Index.

Binance furnishes the Premium Index data for crypto assets on the TradingView platform. This script uses that data to calculate the funding rate.

Binance updates the Premium Index every 5 seconds.

The average Premium Index (denoted **P\_avg**) is the time-weighted average of all Premium Index data points:

P_avg = wma(Premium Index, n)

where **n** is the averaging length.

At each change time—8:00 PM, 4:00 AM, and 12:00 PM (UTC-4)—Binance sets

P_avg = wma(Premium Index, 5 760)

This is the weighted moving average of the last 8 hours because 5 760 × 5 s = 8 h. Binance then calculates the new funding rate:

Funding Rate = P_avg + clamp(interest rate − P_avg, −0.05 %, 0.05 %)

This value updates only at those change times (8:00 PM, 4:00 AM, and 12:00 PM, UTC-4).

**Indicator precision**

TradingView limits historical requests to 5 000 candles. To match Binance exactly, 5 760 candles are required. As a workaround, the script samples the Premium Index every *resolution* seconds (or minutes), where *resolution* is the indicator’s timeframe input.

If it weren't for this limitation, setting resolution = 5 sec, we would get EXACTLY the same result as the official one

**Interest rate**

On Binance Futures, the interest rate is 0.03 % per day by default (0.01 % per funding interval, as funding occurs every 8 hours). This does not apply to certain contracts, such as ETH/BTC, for which the interest rate is 0 %.

**Estimate line**

If the “show estimate” input is enabled, the indicator plots

wma(Premium Index, n) + clamp(interest rate − P_avg, −0.05 %, 0.05 %)

with **n** equal to the number of bars that have elapsed since the last funding-rate change.
Notes de version
In the previous version, at certain times, funding rates returned = na. Now no longer

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.