# Funding Payments (/docs/risex/trading/funding)

The funding rate is the mechanism that keeps the perpetual contract's price anchored to the underlying spot price. Without funding the perp could diverge indefinitely from spot so the funding rate provides a constant economic incentive to keep this gap close. Some key nuances about our funding rate:

* Funding is **peer-to-peer**
* Paid every hour but is computed on an 8-hour rate
* If contract price > spot: longs pay shorts (positive rate)
* If contract price \< spot: shorts pay longs (negative rate)
* We add an implicit 0.01% per 8 hours borrow rate in to simulate the cost of carry (borrow usdc to long BTC)
* Max funding rate per hour is 4% or 32% per 8 hour period
* We use the index price, not the mark price when calculating the notional size

The formula is computed on an 8-hour basis, then divided by 8 for each hourly payment:

**Funding Rate (F) = Average Premium Index (P) + Interest Rate**

***

## Components of the Rate

**Interest rates**

* Fixed at 0.01% per 8 hours (0.00125%/hr or \~11.6% APR) and represents the cost to borrow
* Embeds cost synthetically where longs pay carry cost so always assuming there is more speculation in the market where traders will borrow to be long

**Average Premium Index (P)**

* Measures how far the perp is trading from spot
* Sampled every **5 seconds**, averaged over the hour
* Formula: `Premium = impact_price_difference / oracle_price`

**Impact price difference**

```
impact_price_difference = max(impact_bid_px - oracle_px, 0) - max(oracle_px - impact_ask_px, 0)
```

* `impact_bid_px` = average fill price to buy `impact_notional_usd` worth of the asset
* `impact_ask_px` = average fill price to sell `impact_notional_usd` worth of the asset
* It essentially looks at the average price to buy or sell to determine if the book is trading at a premium or discount when compared to the index price *(what are traders signaling by their positions on the book)*

**Calculation of the rate:**

```
Funding Payment = position_size x oracle_price x funding_rate
```

***

## Example

**Scenario: BTC perp trading at a premium where you hold a $50,000 notional long**

**Step 1 — Calculate premium:**

```
Premium = ($50,100 - $50,000) / $50,000 = 0.2%
```

**Step 2 — Calculate funding rate (no clamp):**

```
F = Premium + Interest Rate = 0.2% + 0.01% = 0.21%
```

**Step 3 — Calculate hourly payment:**

```
Hourly Rate = 0.21% / 8 = 0.0263%
Payment = $50,000 x 0.000263 = -$13.13
```

One difference RISEx brings to the funding rate is the absence of a clamp, making pricing on RISEx a truer representation of the underlying market.
