# Funding Rate Perpetuals

## 🧩 BasisX Funding Rate Perpetuals Specification

### **1. Overview**

**BasisX Tokenised Yield Perpetuals (YPs)** are on-chain contracts that let traders **hedge or speculate directly on yield movements** across both **crypto-native** and **real-world yield markets** — including perpetual funding rates, staking APYs (e.g. stETH, kHYPE), and tokenised bond yields (e.g. TLT, BND).

They are **linear, USDC-settled, and quanto in USD**, meaning all P\&L is denominated in USD but settled in USDC.

YPs **tokenise the carry exposure of yield-producing assets** into a perpetual, composable instrument that can be traded independently of the underlying.

All YPs are currently **isolated-margin only** (cross-margin support to be added later).

YPs are listed on the **BasisX HIP-3 deployment**. For the context of **Funding Rate Perpetuals**, they will be called **FRPs** wherever applicable.\
Matching, funding, liquidations, and order logic are handled by **HyperCore**, while the **oracle and mark price** are bespoke **BasisX** components.\
The **BasisX relayer** transmits oracle and mark price updates approximately **every 3 seconds**.

***

### **2. Mark Price**

The **mark price** — used for margining, liquidations, stop/limit triggers, and unrealized P\&L — is the median of three components:

1. The **Yield Index Oracle Price** (see Section 3).
2. The sum of the oracle price and a **150-second exponentially weighted moving average (EWMA)** of the difference between the YP’s mid-price and the oracle price.
3. The median of **best bid, best ask, and last trade prices**.

At each tick, the BasisX relayer publishes (1) and (2).\
The Hyperliquid protocol computes (3) and takes the **median of all three** to form the final mark.

**This mechanism ensures:**

* Mark stability
* Resistance to manipulation
* Smooth convergence between oracle and market-based valuation

***

### **3. Oracle Price — The Yield Index**

The **oracle** provides the pricing reference for both yield tracking and mark price calculation.

For FRPs, it represents the **Funding Rate Perpetual Index**, a direct exponential mapping of the current annualised yield (`r_apy`) into an index level.

***

#### **3.1 Definition**

The **Funding Rate Perpetual** Index represents the **instantaneous exponential transformation** of the current annualised yield rate:

**P**<sub>**t**</sub>**=e**<sup>**r\_apy**</sup>

Where:

* P<sub>t</sub>: Yield Index at time *t*
* <sup>**r\_apy**</sup> :  Annualised yield rate (APY) at time *t*

This formulation maps every APY into a **positive, smooth price space**, ensuring continuity across rate regimes.

**Key Properties:**

* Always strictly positive (`P_t > 0`)
* Symmetrical handling of positive and negative yields
* Exponential sensitivity to rate changes (higher convexity)
* No need for cumulative or time-weighted compounding
* Fully compatible with HIP-3’s ±1% per-tick limit

***

#### **3.2 Interpretation**

* When **yields rise**, e<sup>**r\_apy**</sup> increases non-linearly, representing higher carry or yield potential.
* When **yields fall** or turn negative, e<sup>**r\_apy**</sup>​ decays below 1.0, representing yield compression or carry loss.
* The rate of change in **P**<sub>**t**</sub>​ directly corresponds to the **change in exponential yield** — producing a smooth, convex price response across different APY regimes.

This approach creates a **continuous, compounding-equivalent index** that represents the yield curve’s instantaneous state without needing a rolling accumulation window.

***

#### **3.3 Examples**

| Scenario            | r\_apy | Formula   | Yield Index (P) | Interpretation            |
| ------------------- | ------ | --------- | --------------- | ------------------------- |
| Stable yield        | 0%     | e^(0)     | **1.0000**      | Neutral baseline          |
| Positive yield      | +10%   | e^(0.10)  | **1.1052**      | Yields up → Index above 1 |
| High yield          | +50%   | e^(0.50)  | **1.6487**      | Strong upward drift       |
| Negative yield      | −10%   | e^(−0.10) | **0.9048**      | Mild downward decay       |
| Deep negative yield | −50%   | e^(−0.50) | **0.6065**      | Sharp contraction         |

**Interpretation:**

* **Long YP** benefits from rising yields or tightening carry regimes.
* **Short YP** benefits from falling or negative yields.
* The non-linear mapping ensures proportional P\&L even at extreme rates.

***

### **4. Internal Pricing Continuity**

The oracle updates **continuously** based on the latest yield observations (`r_apy`).

Each update recalculates:

**P**<sub>**t**</sub>**=e**<sup>**r\_apy**</sup>

and applies HIP-3’s **±1% guardrail** to prevent abrupt market distortions.

If external yield feeds (Pyth, HL funding APIs, or RWA sources) are temporarily unavailable, the oracle holds the last known rate and applies an **EMA smoothing** until live data resumes:

**r**<sub>**t**</sub>**=β**<sub>**t**</sub>**&#x2009; r**<sub>**t−1**</sub>**&#x20;+ ( 1 − β**<sub>**t**</sub>**&#x20;)  r**<sub>**lastKnown**</sub>

where **β**<sub>**t**</sub>**=e**<sup>**−Δt/τ**</sup>**&#x20;τ=8 hours**

***

### **5. Economic Exposure & Use Cases**

#### **5.1 Hedging**

**Example:**\
A trader holds a $1,000 long BTC-PERP on a CEX, paying +10% annualised funding.

They hedge this exposure by **going long FRP-BTC** on BasisX.

If funding rises from +10% → +15% APY:

* CEX position pays more funding (loss)
* FRP price rises (from 1.105 → 1.162) as **e**<sup>**r\_apy**</sup> increases (gain)\
  → **Funding exposure neutralised**

If funding turns negative (e.g., −10% APY):

* CEX position earns funding
* FRP price falls (from 1.105 → 0.905), offsetting the gain

***

#### **5.2 Speculation**

Traders can use YPs to **speculate on yield direction or volatility**:

* **Long YP:** bet yields or funding will increase (bullish leverage demand, tightening cycles).
* **Short YP:** bet yields will fall or turn negative (bearish or risk-off regime).

The exponential mapping makes YPs more responsive to large shifts in yield sentiment — creating a **convex exposure** to yield curve changes.

***

### **6. Notes**

The **e**<sup>**(r\_apy)**</sup> formulation ensures:

* Positive-only oracle and mark prices
* HIP-3 compatibility (±1% per-tick bound)
* Continuous, compounding-equivalent price mapping
* Linear P\&L across small rate changes and convexity across large ones

PnL is computed as:

**P**<sub>**n**</sub>**&#x20;L**<sub>**YP**</sub>**&#x20;= K × N × (P**<sub>**t**</sub>**−P**<sub>**entry**</sub>**)**

where

* **K** = $1
* **N**=notional position size in USD

**Hedge accuracy** verified to within **0.1%** over short horizons, with smooth continuity through rate jumps or regime changes.

***

📘 *BasisX Funding Rate Perpetuals aim to make on-chain funding exposure fully tradable — enabling perpetual funding markets that are composable, hedgeable, and transparent.*
