# 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 funding provides a constant economic incentive to keep this gap close. Funding is peer-to-peer, paid every hour, and computed on an 8-hour rate:

$$
F = \text{clamp}\left(\frac{P + \text{effectiveInterest}}{8},\ -4\%,\ +4\%\right)
$$

If the contract price trades above spot, longs pay shorts (positive rate); if it trades below spot, shorts pay longs (negative rate). RISEx uses the index price, not the mark price, when calculating notional size. Funding rates are clamped at ±4% per hour by default. Some markets carry a per-market interest dampener instead

$$
\text{Funding Payment} = \text{positionSize} \times \text{oraclePrice} \times F
$$

***

## Components of the Rate

### Interest Component

For most markets, the $\text{effectiveInterest}$ is a fixed rate $r = 0.01\%$ per 8 hours ($0.00125\%/\text{hr} \sim 11.6\%$ APR), added on top of the premium. It represents the cost to borrow, embedding cost synthetically where longs pay carry cost - always assuming there is more speculation in the market where traders will borrow to be long.

### Average Premium Index (P)

The premium index measures how far the perp is trading from spot. It's sampled every 5 seconds and averaged over the hour:

$$
P = \frac{\text{impactPrice}}{\text{oraclePrice}}
$$

$$
\text{impactPrice} = \max(\text{impactBid} - \text{oraclePrice},\ 0) - \max(\text{oraclePrice} - \text{impactAsk},\ 0)
$$

* $\text{impactBid}$: average fill price to buy [impactNotional](/docs/risex/trading/oracle-pricing) worth of the asset
* $\text{impactAsk}$: average fill price to sell $\text{impactNotional}$ worth of the asset

This looks at the average price to buy or sell in order to determine whether the book is trading at a premium or discount relative to the index price - what traders are signaling by their positions on the book.

### Interest Rate Dampener

Some markets carry a per-market dampener $d$ around the interest rate $r$, the same way Binance treats funding rates:

$$
\text{effectiveInterest} = \begin{cases} r & \text{if } d = 0 \\ \text{clamp}(r - P,\ -d,\ +d) & \text{if } d > 0 \end{cases}
$$

$$
F = \text{clamp}\left(\frac{P + \text{effectiveInterest}}{8},\ -4\%,\ +4\%\right)
$$

* $d = 0$: the $\text{effectiveInterest}$ is constant, collapsing back to the plain formula above.
* $d > 0$: while $P$ stays inside the stability zone $[r - d,\ r + d]$ (boundaries included), the clamp never saturates and funding is pinned to $F = r/8$. Outside the zone, the dampener absorbs a fixed $d$ worth of the premium and the remainder drives funding as normal:

$$
F = \begin{cases} (P - d)/8 & \text{if } P > r + d \\ (P + d)/8 & \text{if } P < r - d \end{cases}
$$

The dampener only reshapes the interest term - it's independent of the ±4%/hr outer clamp, which applies the same way to every market.

| Market                   | Interest Rate ($r$) | Dampener ($d$) | 1h Cap |
| ------------------------ | ------------------- | -------------- | ------ |
| XAU, XAG, CL, BZ         | 0%/8hr              | 5 bps          | ±4%/hr |
| Others (BTC, ETH, etc,.) | 0.01%/8hr           | 0 (disabled)   | ±4%/hr |

#### Example 1: BTC/USDC, no dampener ($d = 0$)

$P = +6\text{ bps}$, $d = 0$, the $d = 0$ branch executes: $\text{effectiveInterest} = r = 1\text{ bps}$.

$$
F = \frac{6 + 1}{8} = 0.875\text{ bps per settlement}
$$

#### Example 2: XAU/USDC, dampened ($d = 5\text{ bps}$)

$P = +6\text{ bps}$, $d = 5\text{ bps}$, the $d \gt 0$ branch executes

$$
\text{effectiveInterest} = \text{clamp}(1 - 6,\ -5,\ +5) = -5\text{ bps} \\
F = \frac{6 + (-5)}{8} = 0.125\text{ bps per settlement}
$$

Same premium, same market conditions - the dampener reduces funding from $0.875$ to $0.125\text{ bps}$, a 7x reduction, pinning funding to the flat $r/8$ instead of following every small move in the premium.
