> 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/devnet/pricing-and-funding/mark-price.md).

# Mark Price

The **mark price** is Reya's canonical valuation price: margin, unrealised PnL, account exposure, and liquidations are all computed against it — **not** against the index/oracle price. It is recalculated every **second**, rather than on every book change.

## How the mark price is computed

The mark price is the **median of up to three sub-prices**:

```
impactPrice = w_book · (impactBid + impactAsk) / 2  +  w_vwap · emaVwap
price1      = index + EMA( clamp( impactPrice − index, ±premiumClamp ), α )
price2      = Stork CEX-mark feed
markPrice   = median( available of { impactPrice, price1, price2 } )
```

* **`impactPrice`** — walk each side of the book until **`impact_notional`** of notional is consumed, average the two resulting impact (VWAP) prices, and blend with an EMA-VWAP of recent trades via `w_book` / `w_vwap`. The composite is available only once both book sides can support the `impact_notional` walk and the EMA-VWAP has been primed by at least one trade; before the first trade, or when one side of the book is too thin, `impactPrice` is unavailable for that tick.
* **`price1`** — the index anchored by a **clamped, EMA-smoothed premium**: the book's deviation from index is clamped to **±`premiumClamp`** each tick and smoothed by an EMA, so no single print can yank the mark.
* **`price2`** — Stork's CEX-mark feed.
* **`markPrice`** — the median of whichever sub-prices are available (3 → the middle; 2 → their average; 1 → that one; 0 → the tick is skipped).

Taking the **median of three independent sources**, together with the per-tick premium clamp and EMA smoothing, is what makes the mark robust: no single venue, a thin local book, or a momentary print can move it far or fast. This is why the mark price legitimately **deviates from the index** — but only within a bounded, smoothed premium.

### Worked-example parameters

| Parameter              | Value                             |
| ---------------------- | --------------------------------- |
| `impact_notional`      | $10,000                           |
| `premiumClamp`         | 50 bps (±0.5% of index, per tick) |
| `w_book` / `w_vwap`    | 0.5 / 0.5                         |
| EMA `α`                | 0.1                               |
| Recalculation interval | 1 s                               |

These values illustrate the calculation below; they are not a live parameter feed or defaults for every market. API 3.4.0 does not expose the impact notional, premium clamp, blending weights or EMA coefficient. Read the current `markPrice` from `GET /v2/perpMarket/{symbol}/summary` or the market-summary WebSocket channel; see [public configuration and live values](/developers/devnet/reference/markets-and-assets.md#public-configuration-and-live-values). Use that reported value rather than reconstructing the live mark from this example.

### Price validity

Reya checks mark prices for freshness and applies the market's configured deviation bounds relative to the index. Stale prices cannot be used for settlement.

## Fill validation

At settlement, a perp fill must satisfy the permitted deviation from the **mark price**, as well as the **limit price you signed**. A valid fill executes at its matched price. If the mark is stale or the fill falls outside the permitted band, settlement fails and the result is a [trade bust](/developers/devnet/executions-and-settlement/trade-busts.md).

The fill-price reference is the **mark price**, not the index. The permitted deviation is configured per market and is not exposed by API 3.4.0. The 0.5% band in the example below is illustrative, not a discoverable live setting. Set `limitPx` to your acceptable execution price and handle settlement outcomes through the [execution-bust feed](/developers/devnet/executions-and-settlement/trade-busts.md); a matching-engine fill is not a settlement guarantee.

## Worked example

On one tick, for ETH with index = **$3,000**:

| Sub-price                                                                  | Value  |
| -------------------------------------------------------------------------- | ------ |
| `impactPrice` (book trading \~40 bps rich)                                 | $3,012 |
| `price1` (index + smoothed premium; +$12 is within the ±$15 = ±0.5% clamp) | $3,011 |
| `price2` (Stork CEX-mark)                                                  | $3,008 |

`markPrice = median($3,012, $3,011, $3,008) = $3,011`.

A taker fill at **$3,013** with a permitted fill-price deviation of **0.5%** (band = $3,011 ± $15.06 → $2,995.9–$3,026.1) is **within band** and executes at $3,013. A fill at **$3,040** is outside the band and **busts**.

## Reading the mark price

The market summary carries `markPrice` — see the [WebSocket Info API Reference](/developers/devnet/api-reference/websocket-api-reference.md).
