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

# Funding Rates

# Overview

Funding rates for perpetual future contracts are a mechanism to ensure the price of the contract stays close to the underlying asset's price. When the funding rate is positive, long position holders pay funding to the short position holders; when the funding rate is negative, short position holders pay funding to the long position holders.

### Funding Interval

Hotstuff charges hourly funding payments. There are no fees on funding payments.

To aid readability the funding rate is expressed as an 8-hour interest rate.

All the funding payments are transferred between the holders of the perpetual contracts. This makes the funding a zero-sum game, where longs receive all funding from shorts, or shorts receive all funding from longs.

Funding rates are designed to prevent large price disparities between the perpetual contract and the underlying asset. When the funding rate is high, it can incentivize traders to take the opposite position and help to bring the contract's price closer to the spot price of the underlying asset.

### Funding payments

For a user with an open perpetual position, the exact funding payment is calculated as follows:

```
Funding payment = position_size * oracle_price * funding_rate
```

where `oracle_price` is underlying asset's spot index price.

### Funding Rate Calculations

```
impact_price_difference = max(impact_bid_px - index_price, 0) - max(index_price - impact_ask_px, 0)
premium = impact_price_difference / index_price

interestRate_8Hours = 0.01%
interestRate_Hour = 0.00125%

clampLimit = 0.05%

Funding Rate (8 hour) = time_weighted_avg_premium(P) + clamped(interest - Premium)
Funding Rate (Hourly) = Funding Rate (8 hour) / 8
```

where,

* `time_weighted_avg_premium` is the Average Premium Index (P)
* `impact_bid_px` is the avg execution price for a buy order of size `impact_notional_usd`
* `impact_ask_px` is the avg execution price for a sell order of size `impact_notional_usd`
* `impact_notional_usd` is an instrument specific risk parameter

### Funding Rate Caps

Further caps on Funding rates are enforced on a per-instrument basis.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.