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:
[ε, 1−ε] so the mark never sits exactly at 0 or 1 while a market is live, which would make leverage math degenerate.±Δmax), rejecting feed spikes and manipulation.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.
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.