> For the complete documentation index, see [llms.txt](https://docs.koo.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.koo.xyz/risk-and-liquidations/pricing-and-funding.md).

# Pricing & Funding

Koo.xyz perpetual contracts employ a tri-part pricing architecture consisting of the **Index Price**, **Mark Price**, and **Funding Rate**, designed to achieve the following core objectives:

* **External Market Anchoring:** Accurately reflects the fair value of mainstream spot markets.
* **Anti-Manipulation Risk Control:** Prevents malicious price spikes ("wicks") and market manipulation, safeguarding user positions.
* **Price Convergence & Balance:** Ensures perpetual contract market prices converge toward spot prices over time.

***

## 1. Index Price

The index price is the sum of the prices of Spot trading pairs on the major Spot exchanges by trading volume, multiplied by the respective weights of the Spot trading pairs.

The index price depends on three variables: **Spot OB Price**, **USDT-Paired Equivalent** and **Real-time Weight:**

#### Orderbook-Weighted Price

This figure represents the current live price quoted directly from the respective Spot exchanges for the underlying coin asset.&#x20;

Ob Price = (AskPrice1 × BidVolume1 + BidPrice1× AskVolume1) ÷ (BidVolume1+ AskVolume1)<br>

#### **USDT-Paired Equivalent**

This data represents the price of Spot trading pairs converted into USDT trading pairs, based on the current quote.

***Example:***

Let's consider a scenario where the ETHUSDT index includes a component from Exchange A using the trading pair ETH/BTC, with a current quote of 0.1. If the current BTC/USDT price on the Bybit stands at $20,000. In this case, the USDT-paired equivalent value is $2,000 based on the following calculation:

Current Quote × BTC/USDT = 0.1 × 20,000<br>

#### **Real-time Weight**

The Index Price is calculated by summing the weighted prices of Spot trading pairs from top global Spot exchanges. The weight, known as **Trade\_WtO**, is based on the **24-hour trading volumes** of the leading Spot trading pairs. This weight is then applied to the current quote price to determine its impact on the overall Index Price. For clarity, we'll refer to the platforms as A, B, C, D, E, and F in the following examples.

### **1.1 Index Price Calculation**

The calculation formula is as follows:

**Index Price** = (Spot Price\_Symbol A × Trade\_WtO\_Symbol A) + (Spot Price\_Symbol B × Trade\_WtO\_Symbol B) + (Spot Price\_Symbol C × Trade\_WtO\_Symbol C) + (Spot Price\_Symbol D × Trade\_WtO\_Symbol D) + (Spot Price\_Symbol E × Trade\_WtO\_Symbol E) + (Spot Price\_Symbol F × Trade\_WtO\_Symbol F)

***Example***

Let’s assume that the BTC Spot prices and trading volume weights for six trading pairs are as follows:<br>

| **Spot Exchange** | **Trading Pair** | **Spot Price** | **Weight** |
| ----------------- | ---------------- | -------------- | ---------- |
| **A**             | BTC/USDT         | $20,046        | 20%        |
| **B**             | BTC/USDC         | $20,048        | 15%        |
| **C**             | BTC/USDT         | $20,056        | 20%        |
| **D**             | BTC/USDT         | $20,058        | 15%        |
| **E**             | BTC/USDT         | $20,060        | 15%        |
| **F**             | BTC/USDT         | $20,051        | 15%        |

The BTCUSDT index price is $20,052.95 based on the following calculation:

Index Price = ($20,046 × 20%) + ($20,048 × 15%) + ($20,056 × 20%) + ($20,058 × 15%) + ($20,060 × 15%) + ($20,051 × 15%)

### 1.2 Outlier Clipping & Robustness Mechanism

To protect against insufficient liquidity, extreme outlier quotes, or API outages at individual exchanges, the system implements the following safeguards:

1. **Median Outlier Clipping:** When an exchange spot price deviates from the median Median of all reference exchanges by more than 5%, the price is clamped:

   $$P\_i' = \min\left(\max\left(P\_i, 0.95 \times \text{Median}\right), 1.05 \times \text{Median}\right)$$
2. **Invalid Data Removal:** If a data source experiences severe failure or disconnection, its weight is automatically set to zero.
3. **Update Frequency:** The Index Price updates every 1 second.

### 1.3 RWA index

The key unlock for equity or other RWA perpetuals is extending the index price to operate 24/7, beyond external trading sessions of the underlying asset. To achieve this, the system prioritizes external pricing and employs a robust internal mechanism when external data is unavailable.

#### External Pricing <a href="#external-pricing" id="external-pricing"></a>

The platform consumes price data for the underlying assets from a robust set of venues, markets, and institutional data providers. When external markets are in the open session, the externally-derived fair price is transmitted as the index price.

Instrument-specific details for external price derivation can be found in their respective section.

#### Internal Pricing <a href="#internal-pricing" id="internal-pricing"></a>

When external inputs are unavailable(like the traditional market closed), the index price advances via a continuous-time exponentially weighted moving average that incrementally adjusts the previous index price by a fraction of the impact price difference.

When external data becomes unavailable, the internal mechanism initializes from the last available external price. When external inputs resume, the index reverts to the externally derived price on the next tick.

***

## 2. Mark Price

The Mark Price is primarily used for **calculating Unrealized PnL and triggering Liquidations**, effectively preventing unnecessary liquidations caused by temporary order book illiquidity or short-term price spikes.

### 2.1 Formula

$$\text{Mark Price} = P \times C + \text{Index Price} \times (1 - C)$$

Where:

* &#x20;$$P = \text{Index Price} + \text{MA}(\text{Basis})$$ , Basis Moving Average Calculation:
  * $$\text{MA}(\text{Basis}) = \text{MovingAverage}(\text{Basis}, 2.5\text{ min})$$
  * &#x20;$$\text{Basis} = \frac{\text{Bid}\_1 + \text{Ask}\_1}{2} - \text{Index Price}$$ , measured every second
* &#x20;$$C = \text{clamp}\left(\frac{\text{Basis}}{\text{MA}(\text{Basis})}, 0.3, 0.7\right)$$, representing the degree of mid-price deviation each second

### 2.2 Mechanism Characteristics

* **Low Deviation State:** When the order book price deviates minimally from the Index Price, C increases, bringing the Mark Price closer to the mid-market price, increasing sensitivity to short-term market movements.
* **Extreme Deviation State:** When deviation is large, the Mark Price automatically assigns higher weight to the Index Price (converging toward Index Price), effectively blocking market manipulation.
* **Smoothing:** The 2.5-minute moving average (MA) filters out high-frequency market noise.

***

## 3. Funding Rate

The Funding Rate regulates holding costs between long and short positions, driving perpetual contract prices toward spot index prices over time.

### 3.1 Formula

$$F = \text{Clamp}\left( \text{MA}\left\[\frac{\frac{\text{ask}\_1 + \text{bid}\_1}{2} - \text{Index}}{\text{Index}} + I\right], b, a \right)$$

Where:

* **F:** Settlement Funding Rate.
* **ask\_1 & bid\_1:** Best ask and bid prices from the order book.
* **Moving Average (MA) Sampling:** Calculated retrospectively from the current settlement point across the settlement period, sampled **every minute**.

  > **Example:** If the settlement period is 8 hours, at `14:59`, the MA sampling window covers `07:00` to `14:59`, totaling 480 data points (n = 480).
* **Interest Rate I:** Currently set to 0.06% daily for USDT. For an 8-hour settlement period: $$I = \frac{0.06%}{24 / 8} = 0.02%$$

### 3.2 Funding Rate Cap

To keep risk manageable for traders, dynamic upper and lower bounds \[b, a] are enforced:

$$a = (\text{IMR}*{\min} - \text{MMR}*{\min}) \times 0.75$$ $$b = -(\text{IMR}*{\min} - \text{MMR}*{\min}) \times 0.75$$

### 3.3 Funding Payment

$$\text{Funding Payment} = \text{Position Size} \times \text{Funding Rate}$$

* **Funding Rate F > 0:** The market is trading at a premium; **long positions pay short positions**.
* **Funding Rate F < 0:** The market is trading at a discount; **short positions pay long positions**.

***

> **📌 Note:** Koo.xyz charges no intermediary fees on funding payments. All payments are transferred peer-to-peer directly between long and short traders.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.koo.xyz/risk-and-liquidations/pricing-and-funding.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
