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

# Funding

> Funding rates keep perpetual prices aligned with spot prices through periodic payments between traders.

## How It Works

* **When $\text{mark price} > \text{index price}$:** Longs pay shorts (incentivizes selling, reduces perp price)
* **When $\text{mark price} < \text{index price}$:** Shorts pay longs (incentivizes buying, raises perp price)

## Funding Rate

The premium measures how far the perp trades from its index:

$$
\text{premium} = \frac{\text{mark price} - \text{index price}}{\text{index price}}
$$

Phoenix averages the premium over each hour. The 8-hour funding rate $F$ is:

$$
F = m \times \left[P + \text{clamp}\left(I - P,\ -R,\ R\right)\right]
$$

* $P$: average premium over the hour
* $I$: interest rate, $0.01\%$ per 8 hours
* $R$: clamp band radius
* $m$: market multiplier

| Markets | $R$ | $m$ |
| - | - | - |
| Crypto | $0.05\%$ | 1 |
| Equities and ETFs | $0.03\%$ | 0.5 |
| Commodities | $0.03\%$ | 0.5 |
| Pre-IPO (ANTHROPIC) | $0.03\%$ | 0.125 |

When $P$ is within $R$ of $I$, $F = m \times 0.01\%$. For example, a crypto market with zero premium has $F = 0.01\%$, and longs pay shorts.

## Settlement

* Funding settles hourly. Each hour pays $1/8$ of $F$:

$$
\text{hourly funding payment} = \text{position size} \times \text{index price} \times \frac{F}{8}
$$

* Each hour's payment is capped by the market's maximum funding rate. [Market Parameters](https://docs.phoenix.trade/phoenix/market-parameters.md) shows the cap as a percentage of the current mark price.
* Pending funding (but unsettled) can affect account health/liquidation risk in real time

When a trader interacts with the protocol, their pending funding is calculated as:

$$
\text{funding payment}
= \left(\text{current accumulator} - \text{snapshot accumulator}\right)
\times \text{position size}
$$


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