Oracle Price
XYZ oracle price mechanics, including external and internal session mechanics.
The oracle serves two critical functions:
as the reference price for funding.
as a direct input to mark price calculation.
The key unlock for equity perpetuals is extending the oracle to operate 24/7, beyond external trading sessions of the underlying asset. To achieve this, the system prioritizes external pricing and employs a robust internal mechanism when external data is unavailable.
External Pricing
The Relayer consumes price data for the underlying assets from a robust set of venues, markets, and institutional data providers. When external markets are open, the externally-derived fair price is transmitted as the oracle price in relayer updates.
Instrument-specific details for external price derivation can be found in their respective section.
Internal Pricing
When external inputs are unavailable, the oracle advances via a continuous-time exponentially weighted moving average that incrementally adjusts the previous oracle price by a fraction of the impact price difference.
With oracle price S the impact price difference (IPD) is defined as:
where the impact bid price (PimpactBid) and impact ask price PimpactAsk are the average execution prices to trade a configured impact notional amount on the bid and ask sides of the orderbook, respectively. If insufficient depth exists on a side, that side's contribution is set to zero.
The oracle is robust to irregular updates and market halts. It uses a time constant τ=1 hours and updates as:
where Δt∗=min(Δt,cτ), Δt=t−tprev, and c=0.1 (so 1−βt≤1−e−0.1≈9.5%).
Note: This provides the more general form of the continuous-time EMA. Component (2) of the mark price samples the basis (xt=St−Pmid,t) with a time constant τ=150 seconds.
When external data becomes unavailable, the internal mechanism initializes from the last available external price. When external inputs resume, the oracle reverts to the externally derived price on the next tick.
Last updated
Was this helpful?

