Docs
v1.0
DOCS / §04

Oracle & mark price

The mark price is the protocol's read of an event's true probability. It starts as a raw Polymarket implied price and passes through a guard pipeline before anything in the risk system is allowed to use it.

Source

Each perp market is mapped to a Polymarket market whose price expresses the same outcome's implied probability. The Oracle Keeper pulls that price at a fixed cadence and bridges it onto HyperEVM through an oracle adapter registered in the OracleRegistry — Pyth and Chainlink-style adapters are supported. The raw probability is handed to the Mark Price Service, never used directly for margin.

Guard pipeline

The Mark Price Service applies four guards in sequence to turn a raw, possibly noisy or stale feed into a mark the risk engine can trust:

Probability bounds
Clamp into [ε, 1−ε] so the mark never sits exactly at 0 or 1 while a market is live, which would make leverage math degenerate.
Deviation clamp
Limit how far the mark may move in a single update (±Δmax), rejecting feed spikes and manipulation.
Smoothing
An EMA / TWAP over the recent feed removes per-tick jitter. The mark is the smoothed index — stable enough to margin against.
Staleness check
If the feed stops updating past a threshold, the mark is flagged stale and the protocol falls back rather than marking on old data.

Mark vs. index

The pipeline produces two related values:

  • Mark price — the smoothed, guarded probability used for margin, equity, PnL, and liquidation.
  • Index price — the reference the funding engine compares the order book against to compute the premium.

Keeping them distinct means funding measures the book's deviation from a clean reference, while risk always uses a value that can't be jerked around by a single source glitch.

Publishing

The guarded mark is published two ways. Off-chain it is cached per market and emitted as mark_price.event for the gateway, risk, funding, and liquidation engines. On-chain it is written to the MarketRiskRegistry via pushSnapshot(indexPrice, markPrice, timestamp, phase), giving the position and settlement contracts a trust-anchored price to validate margin and liquidation against. Push cadence is bounded by a minimum snapshot delay.

Why on-chain Settlement and liquidation contracts independently verify the operator's actions against the most recent on-chain snapshot, so the off-chain engines can be fast without being unilaterally trusted.

Fallback behavior

If Polymarket is unreachable or stale, the keeper holds the last good mark, flags staleness, and defers price-sensitive actions. Sustained staleness can move a market into a reduced-risk state rather than continuing to liquidate against an unreliable price.