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

# Oracle & Index Prices

The **index price** is the external reference price for a market. On Reya it comes from **Stork**, a low-latency oracle network. It is an *input* to pricing — **not** the price your positions are marked at. That is the [mark price](/developers/pricing-and-funding/mark-price.md), which is built around the index but is not equal to it.

{% hint style="info" %}
**RWA markets** (gold, silver, oil, US equities and ETFs) use separate, USDC-denominated Stork feeds: an exchange index (`<ASSET>USDC_IDX`) and an external actual mark (`<ASSET>USDC_MK`), each a median of perpetual-venue prices and published 24/7, including while the underlying market is closed. See [RWA Markets](/developers/pricing-and-funding/rwa-markets.md). The crypto feeds and USD conversion described below don't apply to them.
{% endhint %}

## Stork feeds

Each crypto market is configured with **two Stork feeds**:

| Feed           | Example (ETH) | Role                                                                                                               |
| -------------- | ------------- | ------------------------------------------------------------------------------------------------------------------ |
| **Spot index** | `ETHUSD`      | the market's index / peg price                                                                                     |
| **CEX mark**   | `ETHUSDMARK`  | one of the three inputs to the [mark price](/developers/pricing-and-funding/mark-price.md), and its on-chain bound |

Reya validates oracle updates for authenticity and freshness. Stork prices older than **10 seconds** are excluded from mark-price and funding calculations until a fresh update arrives.

## What the index price is used for

The index price is **not** the valuation price. It feeds two things:

1. **The mark-price anchor** — the mark price is the index plus a bounded, smoothed premium (see [Mark Price](/developers/pricing-and-funding/mark-price.md)).
2. **The funding premium** — funding is driven by how far the book trades from the index (see [Funding](/developers/pricing-and-funding/funding.md)).

The index does not bound the mark price on-chain. The CEX mark feed does.

## What the CEX mark feed is used for

The CEX mark feed has two roles:

1. **A mark-price input.** It is `price2`, one of the three sub-prices in the median (see [Mark Price](/developers/pricing-and-funding/mark-price.md)).
2. **The on-chain bound on the mark price.** Each new mark price pushed on-chain is compared with the market's CEX mark feed, converted to USDC with `USDCUSD`. The push is rejected if the mark deviates from that reference by more than the market's configured tolerance. It is also rejected if the CEX mark or `USDCUSD` feed is stale.

Fills are not compared with the CEX mark feed or the index directly. A perp fill is checked against the on-chain mark price (see [Fill validation](/developers/pricing-and-funding/mark-price.md#fill-validation)). Every accepted mark was within tolerance of the CEX mark feed when it was pushed, so fills are anchored to that feed indirectly.

## Reading prices

* **Asset oracle prices** — read `GET /v2/assetOraclePrices` or subscribe to WS `/v2/assetOraclePrices`. The feed returns `asset`, `oraclePrice`, and `updatedAt`, and deliberately has no AMM-era `poolPrice`.
* **Perp summary oracle price** — read `oraclePrice` from REST `GET /v2/perpMarkets/summary` or `GET /v2/perpMarket/{symbol}/summary`, or the corresponding WS channels. It carries the underlying's Stork spot feed (`<BASE>USD`, for example `ETHUSD`), divided by `USDCUSD` to quote in USDC (rUSD). The API field name stays `oraclePrice`. Missing spot ticks, ticks older than 60 seconds, or an unavailable cross-rate cause omission, with no CEX-mark fallback. Spot summaries use the same feed family and conversion; wrapped-token markets retain their own collateral feed (for example `WBTCUSD` rather than `BTCUSD`). For [RWA perps](/developers/pricing-and-funding/rwa-markets.md), `oraclePrice` is the fresh `<ASSET>USDC_IDX` value, already quoted in USDC, with no `USDCUSD` conversion or dependency; the 60-second age limit still applies.
* **Mark price** — read it from the market summary's `markPrice` field (see [Mark Price](/developers/pricing-and-funding/mark-price.md)).
* **Removed legacy prices feed** — `/v2/prices` and `/v2/prices/{symbol}` are removed. Use asset oracle prices for collateral/index prices, market summary `markPrice` for perp valuation, and depth/summary fields for book prices.

## Staleness

Oracle prices carry a **staleness bound**. A price that hasn't updated within its allowed window is treated as stale and rejected on-chain rather than used.

For perps this works in two steps. A mark-price push is rejected while the market's CEX mark or `USDCUSD` feed is stale, so the on-chain mark stops updating. Once the on-chain mark is older than its own staleness window, anything on-chain that needs it reverts. That includes fills and liquidations in that market. It also includes margin checks, such as on withdrawals, for any account with a position in that market. A failed fill comes back as a [trade bust](/developers/executions-and-settlement/trade-busts.md).
