Funding
Funding rates for crypto perpetual contracts help keep the contract price aligned with the underlying asset. This peer-to-peer fee is paid by one side (long or short) to the other, with no exchange fees collected.
The rate is based on the difference between the contract's price and the spot price. Longs pay shorts when the contract price is higher than the spot price, and shorts pay longs when it's lower.
On Hibachi, funding payments are made every 8 hours—at midnight UTC, 8:00 AM UTC, and 4:00 PM UTC—and directly adjust contract balances. This mechanism helps prevent significant price disparities between the contract and the underlying asset, promoting market alignment.
Calculations
The funding process operates in discrete intervals of 1 second. There are 28,800 seconds in an 8-hour interval.
t
represents the current second within the 8-hour interval.
Spot Index Price
Calculated by sampling the spot index price (si
) from the oracle every second and compute its moving average from second 0 to t
. This moving average si
serves as the live spot index for funding estimation. At t = 28,800
, it becomes the Final Spot Index Price (fsi
).
Perp Index Price
Calculated by sampling the perp orderbook's mid-price every second and compute its moving average from second 0 to t
. This moving average serves as the live perp index (pi
) for funding estimation. At t = 28,800
, it becomes the Final Perp Index Price (fpi
).
Funding Calculations
Before the end of the period (t < 28,800
), the Predicted Funding Rate is estimated as:
At the end of the period (t = 28,800
), the Final Funding Rate is calculated as:
Last updated