# RWA Pricing Mechanism

RWA pricing is derived from two primary sources: external oracle feeds (e.g., Chainlink, Pyth, Stork, and other exchanges) and internal pricing.

* The index price is calculated according to the pricing methodology defined below.
* The only change is that the `cexPrices` component is replaced with the pricing methodology defined below.

### **Pricing Transition**

External oracle feeds are the primary price source. When oracle data becomes stale, the pricing mechanism gradually shifts from oracle-based pricing to internal pricing. As soon as an external price is available, the internal price is going to instantly converge to it.

Weights are normalized across sources. On each tick where an external price is not available:

1. Apply exponential decay to the oracle source
2. Allocate the remaining weight to the internal source

#### **Reweighing Formula (stale oracle prices):**

$$
w\_{\text{oracle}}(t)
=====================

w\_{\text{oracle}}(t - 1)\cdot e^{-\frac{\Delta t}{\tau\_{\text{oracle}}}}
$$

$$
w\_{\text{internal}}(t)
=======================

1 - w\_{\text{internal}}(t)
$$

Where:

* Δt: time elapsed since the last update
* τ\_active: source-specific time constant

#### Time Constants&#x20;

The time constant could vary by price type (index vs. mark).

* $$\tau\_{\text{mark}} = 1 \text{ minute}$$
* $$\tau\_{\text{index}} = 1 \text{ minute}$$

Note that the transition from internal to external is instant.

***

### Internal Pricing

Internal pricing is derived from order book impact prices, smoothed using a time-weighted Exponential Moving Average (EMA).

#### Time-Weighted EMA

$$
EMA\_t = \alpha \cdot P\_t + (1 - \alpha) \cdot EMA\_{t-1}
$$

$$
\alpha = 1 - e^{- \Delta t / \tau}
$$

* **Pₜ** — current impact price
* **τ** — smoothing time constant
* **Δt** — time since last update

***

### Index Price

For index price we set:

* $$\tau = 30 \text{ minutes}$$

The internal index price is capped relative to the last oracle price and the leverage of the market:

* **Indexᵢₙₜₑᵣₙₐₗ ∈ \[ P\_oracle · (1 − 1/L), P\_oracle · (1 + 1/L) ]**
  * Where **L** is leverage.

***

### Mark Price Component

For mark price we set:

* $$\tau = 2 \text{ minutes}$$

The mark price is capped relative to the last oracle price and the leverage of the market:

* **Markᵢₙₜₑᵣₙₐₗ ∈ \[ P\_oracle · (1 − 1/L), P\_oracle · (1 + 1/L) ]**

A simulation:

<figure><img src="https://1186887628-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXuISSHTfjHCg60BNss6v%2Fuploads%2F2WyZ6cI7PiskdMA8AKUo%2Fimage.png?alt=media&#x26;token=c845ccbe-203f-40a0-9d72-8e0a9ba464c8" alt=""><figcaption></figcaption></figure>

***

### Non-USD\* Quoted Perpetual Contracts

**Korean equities:** Contracts are settled in USDC, while the reference price of the underlying is quoted in KRW. The contract tracks the performance of the underlying asset in KRW, but each full contract is priced and settled in USDC. In practice, this means you pay the displayed contract price in USDC, even though the market follows the underlying’s KRW price movements.&#x20;


---

# Agent Instructions: 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.lighter.xyz/trading/real-world-assets-rwas/rwa-pricing-mechanism.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.
