Robust Price Indices
GX Exchange uses a multi-source oracle system and composite mark price to ensure accurate and manipulation-resistant pricing for all perpetual markets.
Oracle Price
The oracle price is the primary external price reference, derived from a weighted median of price feeds from 8 centralized exchanges:
| Exchange | Weight |
|---|---|
| Binance | 3 |
| OKX | 2 |
| Bybit | 2 |
| Kraken | 1 |
| KuCoin | 1 |
| Gate.io | 1 |
| MEXC | 1 |
| GX Exchange | 1 |
Total weight: 12
Update Mechanism
- Validators submit oracle price observations every 3 seconds
- Each validator fetches prices from the 8 sources and computes a weighted median
- The final oracle price is the stake-weighted median of all validator submissions
- This two-layer median (source-level then validator-level) provides robust protection against any single exchange being manipulated or experiencing an outage
Weighted Median Computation
The weighted median selects the price at which cumulative weight reaches 50% of total weight. With total weight 12, the median price is the value where cumulative weight reaches 6. This ensures that at least 3 high-weight exchanges (or a combination of lower-weight ones) must agree for the oracle to move.
Mark Price
The mark price is used for margin calculations, liquidation checks, and PnL computation. It is computed as the median of three components:
- Oracle + EMA premium:
oracle_price + EMA(mark_price - oracle_price) - Order book mid-price: Median of best bid, best ask, and last trade price
- External perpetual median: Median of perpetual contract prices from other venues
mark_price = median(
oracle_price + ema_premium,
median(best_bid, best_ask, last_trade),
external_perp_median
)EMA Premium
The EMA (Exponential Moving Average) of the basis (mark minus oracle) smooths out transient deviations between the on-exchange price and the oracle. This prevents mark price from spiking due to momentary order book imbalances.
The EMA uses a decay factor calibrated to the funding interval, giving recent observations more weight while maintaining stability.
Impact Price
Impact prices measure the cost of executing a given notional size against the order book. They are used in funding rate calculations:
impact_bid = average execution price for a $N sell market order
impact_ask = average execution price for a $N buy market orderImpact notional thresholds:
| Market | Impact Notional ($N) |
|---|---|
| BTC-USD, ETH-USD | $20,000 |
| All other markets | $6,000 |
Price Staleness Protection
If an oracle source has not updated within a configurable timeout:
- The stale source is excluded from the weighted median
- If fewer than 3 sources are fresh, the oracle freezes at the last valid price
- If the oracle is frozen, new orders may be rejected and liquidations are paused until fresh data is available
Prelaunch Market Pricing
Prelaunch markets (pre-listing perpetuals) use a specialized oracle:
- 8-hour EMA of minutely mark price samples instead of the standard weighted median
- Oracle price is capped at 4x the initial listing price to prevent manipulation
- Mark price is capped at 3x the EMA to limit sudden spikes
- Once the underlying asset lists on a major exchange, the market converts to the standard oracle system
See Prelaunch Markets for details.