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

# Internal Pricing Mechanism

Most perpetual markets on Lighter obtain their index price from external sources (see [Fair Price Marking](/trading/fair-price-marking.md)). Markets whose underlying has no continuous external price need an additional price source based on the order book. This page describes that mechanism.

### Which markets use it

* **RWA markets** (equities, indices, commodities, FX): external prices are the primary source; internal pricing takes over when those prices become stale, typically outside the underlying's trading hours.
* **Pre-IPO markets** (e.g. OPENAI, ANTHROPIC, OURA): these markets have no external feed, so internal pricing is the only source. See [Pre-IPO Markets](/trading/real-world-assets-rwas/pre-ipo-markets.md).
* **Prelaunch markets** (crypto tokens before TGE, also called pre-markets, e.g. XTEN): as with Pre-IPO markets, internal pricing is the only source. See [Prelaunch Markets](/trading/prelaunch-markets.md).

The index price is calculated according to the pricing methodology defined below. For [mark price](/trading/fair-price-marking.md), the only change is that the `cexPrices` component is replaced with the pricing methodology defined below.

### Pricing transition

External oracle feeds (e.g. Pyth, Chainlink, RedStone, Stork and Ornn) and prices from other trading venues are the primary price source. When external prices become stale, pricing shifts to the internal price. The current mainnet stale threshold is typically 1 minute; it can vary by market. As soon as a fresh external price is available, pricing switches back to it.

***

### Internal pricing

The internal price is derived from order book impact prices, smoothed using a time-weighted Exponential Moving Average (EMA). Under the current 1% spread threshold, updates whose impact bid/ask spread exceeds 1% of the impact price are ignored and do not move the 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 the index price, the default smoothing time constant is:

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

For RWA markets where an oracle-relative cap is enabled, the internal index price is capped relative to the last oracle price and the market's maximum leverage:

* **Indexᵢₙₜₑᵣₙₐₗ ∈ \[ P\_oracle · (1 − 1/L), P\_oracle · (1 + 1/L) ]**
  * where **L** is the market's maximum leverage (`1 / IMR`), for both index and mark-price caps.

***

### Mark price component

For the internal mark-price component, the default smoothing time constant is:

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

For RWA markets where an oracle-relative cap is enabled, the internal mark-price component is capped relative to the last oracle price and the market's maximum leverage:

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

A simulation:

<figure><img src="https://855888483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHkh5jOwCd7orp1uLEdzQ%2Fuploads%2FSBEUUZvjE24XmWDNAuK7%2F03-rwa-pricing.png?alt=media&amp;token=08225d4d-1b58-4f5a-89e9-9404f7537ca8" alt=""><figcaption></figcaption></figure>

***

### Prelaunch and Pre-IPO markets

These markets have no external price feed, so they use the internal price at all times. Two things differ from RWA markets:

* **Index price:** the internal EMA (τ = 30 minutes) is used directly, with no price cap.
* **Mark price component:** the internal EMA (τ = 2 minutes) is capped relative to the current index price instead of an oracle price:

**Mark\_internal ∈ \[ P\_index · (1 − 1/L), P\_index · (1 + 1/L) ]**

Here L is the market's maximum leverage. For example, on a 5× market the internal mark-price component can be at most 20% away from the index price.

Before the first trades, a market starts from a reference price set at listing. See [Pre-IPO Markets](/trading/real-world-assets-rwas/pre-ipo-markets.md#delisting-after-an-ipo) for delisting and settlement rules after an IPO.

The current price source and any applied cap for each market are returned by [GET /api/v1/priceOracleInfo](https://docs.lighter.xyz/api/info/priceoracleinfo) (`pre_market`, `index.source`, `mark.price_cap_bps`, `mark.price_cap_reference_price`).

### Price cap removal (2026-07-10)

Since July 10, 2026, the following RWA markets have no price caps based on the last oracle price:

SPY, US500, QQQ, US100, XAU, XAG, NVDA, TSLA, AAPL, AMZN, MSFT, GOOGL, META, XCU, SNDK, WTI, XPD, XPT, BRENTOIL, MU, EWY, SPCX, DRAM, SOXL, SKHYNIXUSD, SAMSUNGUSD, INTC, NATGAS, IBM, AMD, MSTR

To prevent manipulation attacks, internal prices will continue to be validated against prices from other trading venues (see [Risk Checks](/trading/fair-price-marking.md#risk-checks)).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lighter.xyz/trading/internal-pricing-mechanism.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
