Equities
Oracle Price
For equities and stock-linked perpetuals, the oracle price is provided by Polygon.io feeds. These are updated in near real-time during regular U.S. trading hours and adjusted for pre- and post-market activity based on liquidity conditions.
Mark Price
For equity perpetuals, the mark price is computed as the median of three independent methods, ensuring continuity in calculation structure while accounting for the unique properties of equities and off-hour trading.
Method 1: Mid-price Basis Adjustment
Mid(t) = (BestBid + BestAsk) / 2
Basis(t) = Mid(t) − OraclePrice(t)
τ_basis = 150 secondsA 150-second exponential moving average (EMA) of the basis term smooths short-term volatility and aligns the onchain order book with the oracle feed. This helps stabilize the mark price during normal trading hours and prevents sudden spikes from temporary order book imbalances.
Method 2: Last Traded Price
The most recent traded price on Margin Trade is included to reflect actual market activity and ensure responsiveness when liquidity is active.
Method 3: Oracle Price Funding Adjustment
Equity perpetuals incorporate expected funding rate adjustments directly into the mark price:
mark_price_equity_method3 = oracle_price × (1 + funding_rate × (hours_until_next_funding / 8))This adjustment anticipates the impact of the next funding payment and ensures that the perp’s price remains close to its fair value over time.
During periods when traditional equity markets are closed, the oracle feed (provided by Polygon.io) continues to update, but the system applies additional smoothing and circuit-breaker constraints to reflect reduced liquidity.
The final mark price for equity perpetuals is determined as the median of the three methods:
This design ensures that Margin Trade equity perps remain:
Fair — tracking true market value
Robust — resilient to manipulation or thin order books
Continuous — stable during pre- and post-market hours with smoothed off-hour behavior
Last updated

