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

# Pricing & Funding

## **概述**

本协议采用由**指数价格（Index Price）**、标记价格（Mark Price）**和**资金费率（Funding Rate）构成的定价体系，用于实现：

* 外部市场价格锚定
* 抗操纵的风险控制
* 永续合约价格向现货价格收敛

***

## **1. 指数价格（Index Price）**

指数价格基于多个交易所现货价格的加权平均计算：

```
Index Price = Σ (w_i × P_i)
```

其中：

* P\_i：第 i 个交易所现货价格
* w\_i：对应权重，满足 Σ w\_i = 1

为增强鲁棒性：

* 当价格偏离中位数超过 5% 时进行裁剪：

```
P_i' = min(max(P_i, 0.95*Medium), 1.05*Medium)
```

* 异常或失效数据对应权重置为 0

最终：

```
Index Price = Σ (w_i × P_i')
```

指数价格每秒更新一次。

***

## **3. 标记价格（Mark Price）**

标记价格用于清算与盈亏计算。

***

### **3.1 计算公式**

```
Mark Price = P × C + Index Price × (1 - C)
```

**其中**

* P = Index Price + MA(Basis)
  * MA(Basis) = MovingAverage(Basis, 2.5 min)
  * Basis = (Bid₁ + Ask₁) / 2 - Index Price
* C = clamp(Basis / MA(Basis), 0.3, 0.7)

### **3.2 机制特性**

* 当市场偏离较小时：Mark Price 更接近盘口价格
* 当偏离较大时：Mark Price 向 Index Price 收敛
* MA 平滑降低短时噪音影响

***

## **4. 资金费率（Funding Rate）**

资金费率由 利率（Interest, I）**与**溢价指数（Premium Index, P）构成，用于驱动永续合约价格向指数价格收敛。

***

### **4.1 资金费率公式**

```
F = Clamp(MA [{(ask1 + bid1) / 2 - Index} / Index + I], b, a)
```

其中：

* F：资金费率
* ask1 / bid1：来自订单簿的最优买卖价格
* 移动平均(MA)计算方式：以当前时间点为基准，向前回溯对应结算周期长度内的溢价指数数据，并对窗口内的所有有效数据进行计算，溢价指数数据按每分钟采样。
  * 假设某合约的资金费用结算周期为8 小时，当时间为14:59 时，资金费率计算所使用的MA 数据范围为07:00 至14:59 期间每分钟采集的溢价指数数据，共480 个数据点（n = 480）。
* I：利率，当前USDT的日利率为0.06%。每8小时结算的周期利率 I = 0.06% / (24 / 8)

上下限约束

* a = (IMR\_min - MMR\_min) × 0.75
* b = -(IMR\_min - MMR\_min) × 0.75

***

### **4.2 资金费支付**

```
Funding Payment = Position Size × Funding Rate
```

* Funding Rate > 0：多头支付空头
* Funding Rate < 0：空头支付多头


---

# 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:

```
GET https://docs.kryptox.finance/risk-and-liquidations/pricing-and-funding.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
