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

# Funding

> When funding is active, why it can be zero, and how rates are computed.

Funding keeps perpetual prices anchored to their underlier. QFEX supports 24/7 trading, but funding is only active when we can reliably consume underlier prices from primary venues.

## At a Glance

* Funding is calculated and settled every **60 minutes**.
* Funding is only active during a symbol's configured `market_hours`.
* Outside those hours, funding rate is **`0`** and no funding payment is exchanged.
* The live websocket `funding` stream shows the **current implied final rate** if the current window ended now.

## Funding Hours (Current)

| Asset class             | Underlier venue/source  | Funding-active hours                    |
| ----------------------- | ----------------------- | --------------------------------------- |
| US Equities             | US Securities Exchanges | 24/5                                    |
| Korean Equities         | KSE                     | 23:45-06:45 UTC on weekdays             |
| Indices and Commodities | US Future Exchanges     | 23/5, pause at 16:00-17:00 Chicago Time |
| FX and Precious Metals  | Relevant FX venues      | 24/5                                    |

## Per-Symbol Funding Hours in Refdata

Always use refdata as the source of truth for symbol-specific funding hours:

* REST: `https://api.qfex.com/refdata`, docs [here](/websocket/channels/mds/refdata)

Look at the `market_hours` object for each symbol.

```json theme={null}
{
  "symbol": "AAPL-USD",
  "market_hours": {
    "tz": "America/New_York",
    "monday": { "open": "04:00:00", "close": "20:00:00" }
  }
}
```

## Methodology

Our calculation methodology closely follows the industry standard, with simplified parameters for greater transparency and efficiency.

**Key Parameters:**

* **Funding Interval:** Every **60 minutes**.
* **Impact Notional:** **10,000 USDC** (**100,000 USDC** for FX pairs).
* **Interest Rate:** **None**.

### 1. Premium Index

The Premium Index ($P$) represents the premium or discount of the contract relative to the spot price. It is calculated using the **Impact Bid** and **Impact Ask** prices from the orderbook.

$$
P = \frac{\max(0, \text{Impact Bid} - \text{Index}) - \max(0, \text{Index} - \text{Impact Ask})}{\text{Index}}
$$

Where:

* **Impact Bid:** The average fill price to sell the Impact Notional amount.
* **Impact Ask:** The average fill price to buy the Impact Notional amount.

### 2. Funding Rate

The final Funding Rate applied at the end of each 60-minute interval is based on a **Time-Weighted Average (TWAP)** of the Premium Index over that interval. This method assigns higher weight to more recent premium observations.

> **Note:** In the formula below, $\bar{P}$ and $F_{\text{raw}}$ are expressed in **basis points (bps)**.

$$
\bar{P} = \frac{\sum_{i=0}^{N-1} (i+1) \cdot P_i}{\sum_{i=0}^{N-1} (i+1)}
$$

$$
F_{\text{final}} = \frac{\bar{P}}{100}
$$

Where:

* $P_i$ represents the premium samples.
* The weight $(i+1)$ increases for more recent samples (where $i=N-1$ is the most recent).
* $F_{\text{final}}$ is the funding rate applied for payments and published on the funding stream.

*Note: Unlike other exchanges, we do not apply a fixed interest rate component. The rate is purely the market-driven premium.*

## Why Funding May Be 0

Funding can be zero for normal reasons:

* The symbol is outside its `market_hours` (market closed, weekend, or holiday).

## Historical Funding Data

We are actively improving historical data coverage, including funding history by product. For live values, use the websocket `funding` channel.
