Skip to Content
TradingOracle and mark prices

Oracle and mark prices

Every perp has two reference prices. The oracle price is the price the perp tracks, shown as Oracle in the perp’s header. The mark price is Loaf’s estimate of the perp’s fair price, built from the oracle price, the perp’s own order book and outside markets, and kept within the market’s own band around the oracle price. Many exchanges call the oracle price the index price.

PriceHow it is setUsed for
Oracle pricePerp-only markets: a price recipe for each market, read from outside venues and applied once two of the three signer hosts Loaf runs sign it. Perps on physical markets: the spot market’s own prices on Loaf, with no outside venues until enough liquidity trades there.Funding, and the prices of exits, settlements and forced closes
Mark priceThe median of three estimates of the perp’s fair price, kept within the market’s own band around the oracle priceMargin, liquidations, auto-deleveraging ranking, stop and take-profit triggers, the order price band, and profit and loss

Oracle price

Each perp-only market has its own price recipe:

MarketOracle priceHow often
GoldThe median of major exchanges’ own gold indexes. A price more than 1% from the median is left out, and at least two prices must remain.Once a second
H100 GPU computeA major exchange’s own H100 index. If the exchange’s H100 index jumps more than 5% from the last price used, the price stays at that last price. It moves again when the exchange’s H100 index comes back within 5% of it, or when Loaf confirms the move. The market stays open meanwhile.Once a second
Copper, lithium, uranium, iron ore and electricityTBCTBC

A proposer computes each price from the market’s recipe, and it is then checked. A price that would move faster than the market’s move limit is held until Loaf releases it, and the market is reduce-only meanwhile. Oracles and price feeds explains how prices are sourced, signed and checked.

For perps on physical markets, the spot market’s price bands limit how far its price can move at once; see Halts and price bands.

Mark price

The mark price is the median of three estimates:

  1. Oracle plus premium. The oracle price plus a 2-minute average of how far the perp’s book sits above or below it, capped per market at up to 0.5% TBC.
  2. The perp’s own book. The midpoint of the perp’s impact bid and impact ask: the average prices to sell, and to buy, the market’s impact notional, by default US$100 times its maximum leverage. Every resting order counts, however far it sits from the oracle price, and both sides must be able to fill the impact notional.
  3. Outside perps. The weighted median of the same perp’s prices on outside venues TBC.

An estimate that is missing counts as the oracle price. The median is then kept within a band around the oracle price, which the validity proofs check on every market. The band is set by the market’s maintenance rate: on each side of the oracle price, it is the maintenance rate ÷ (1 + the maintenance rate), less 1 percentage point. That is 8.09% on a market with 5x maximum leverage, 3.76% at 10x, and 10.11% for H100 compute. While a market’s premium cap is 0 and no outside price is available, the mark equals the oracle price.

The mark moves each time a new oracle price is accepted: every second for gold and H100 compute.

A mark price built this way means liquidations are determined by a price no single participant can set. On venues whose mark follows their own book, a large order can push a thin book through a cluster of liquidation prices. Because Loaf’s mark is a median of three estimates, no single estimate sets it. One trade on a thin book changes only the perp’s own book, and the band around the oracle price limits how far the mark can stray, so a push on the book cannot fire a stop or a liquidation by itself.

Last updated on