OPEN-SOURCE SCRIPT

Predicted Funding Rates

1 073
Overview

The Predicted Funding Rates indicator calculates real-time funding rate estimates for perpetual futures contracts on Binance. It uses triangular weighting algorithms on multiple different timeframes to ensure an accurate prediction.

Funding rates are periodic payments between long and short position holders in perpetual futures markets
  • If positive, longs pay shorts (usually bullish)
  • If negative, shorts pay longs (usually bearish)


This is a prediction. Actual funding rates depend on the instantaneous premium index, derived from bid/ask impacts of futures. So whilst it may imitate it similarly, it won't be completely accurate.

This only applies currently to Binance funding rates, as HyperLiquid premium data isn't available. Other Exchanges may be added if their premium data is uploaded.

Methods

Method 1: Collects premium 1-minunute data using triangular weighing over 8 hours. This granular method fills in predicted funding for 4h and less recent data

Method 2: Multi-time frame approach. Daily uses 1 hour data in the calculation, 4h + timeframes use 15M data. This dynamic method fills in higher timeframes and parts where there's unavailable premium data on the 1min.

How it works
1) Premium data is collected across multiple timeframes (depending on the timeframe)
2) Triangular weighing is applied to emphasize recent data points linearly

Pine Script®
Tri_Weighing = (data[0]*1 + data[1]*2 + data[2]*3 + data[3]*4) / (1+2+3+4)


3) Finally, the funding rate is calculated

Pine Script®
FundingRate = Premium + clamp(interest rate - Premium, -0.05, 0.05)


where the interest rate is 0.01% as per Binance

Triangular weighting is calculated on collected premium data, where recent data receives progressively higher weight (1, 2, 3, 4...). This linear weighting scheme provides responsiveness to recent market conditions while maintaining stability, similar to an exponential moving average but with predictable, linear characteristics

A visual representation:

Data points: [old] ──────────────> [new]
Weights: 1 2 3 4 5
Importance: ▂ ▃ ▅ ▆ █

How to use it

For futures traders:
  • If funding is trending up, the market can be interpreted as being in a bull market
  • If trending down, the market can be interpreted as being in a bear market
  • Even used simply, it allows you to gauge roughly how well the market is performing per funding. It can basically be gauged as a sentiment indicator too


For funding rate traders:
  • If funding is up, it can indicate a long on implied APR values
  • If funding is down, it can indicate a short on implied APR values
  • It also includes an underlying APR, which is the annualized funding rate. For Binance, it is current funding * (24/8) * 365


For Position Traders: Monitor predicted funding rates before entering large positions. Extremely high positive rates (>0.05% for 8-hour periods) suggest overleveraged longs and potential reversal risk. Conversely, extreme negative rates indicate shorts dominance

Table:
  • Funding rate: Gives the predicted funding rate as a percentage
  • Current premium: Displays the current premium (difference between perpetual futures price and the underlying spot) as a percentage
  • Funding period: You can choose between 1 hour funding (HyperLiquid usually) and 8 hour funding (Binance)
  • APR: Underlying annualized funding rate


What makes it original
Whilst some predicted funding scripts exist, some aren't as accurate or have gaps in data. And seeing as funding values are generally missing from TV tickers, this gives traders accessibility to the script when they would have to use other platforms

Notes
  • Currently only compatible with symbols that have Binance USDT premium indices
  • Optimal accuracy is found on timeframes that are 4H or less. On higher timeframes, the accuracy drops off
  • Actual funding rates may differ


Inputs
  • Funding Period: Choose between "8 Hour" (standard Binance cycle) or "1 Hour" (divides the 8-hour rate by 8 for granular comparison)
  • Plot Type: Display as "Funding Rate" (percentage per interval) or "APR" (annualized rate calculated as 8-hour rate × 3 × 365)
  • Table: Toggle the information table showing current funding rate, premium, funding period, and APR in the top-right corner
  • Positive Colour: Sets the colour for positive funding rates where longs pay shorts (default: #00ffbb turquoise)
  • Negative Colour: Sets the colour for negative funding rates where shorts pay longs (default: red)
  • Table Background: Controls the background colour and transparency of the information table (default: transparent dark blue)
  • Table Text Colour: Sets the colour for all text labels in the information table (default: white)
  • Table Text Size: Controls font size with options from Tiny to Huge, with Small as the default balance of readability and space

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน