# Pricing (Oracles)

### Oracle Architecture

Oracles play a vital role in a decentralized exchange (DEX) by enabling MUNE’s on-chain contracts to access external price data (e.g., spot and perpetual market prices) in real-time. MUNE integrates with Orderly Network’s oracle infrastructure, which is optimized for low-latency updates and high reliability across supported market pairs.

Orderly’s oracle system derives prices from a carefully selected set of centralized exchanges and calculates an index price through a Time-Weighted Average Price (TWAP) mechanism, ensuring robust and manipulation-resistant pricing.

#### Key Oracle Features:

* **Low Latency** – Updates are frequent and reflect real market activity.
* **Redundancy** – Multiple sources prevent reliance on any single venue.
* **Resilience** – Designed to handle volatility and avoid stale data.
* **Precision** – Indexes use volume-weighted average pricing (VWAP) to accurately reflect global liquidity.

***

#### Price Types on MUNE via Orderly

1. **Spot Oracle Price**\
   Index price derived from exchanges like Binance, Coinbase Pro, and Kraken.\
   This price is TWAP-calculated and used as the primary reference for liquidations.
2. **Perpetual Index Price**\
   A volume-weighted average of perpetual contract prices across major exchanges such as Binance, OKX, and ByBit.\
   Prices are converted from USDT to USD using volume-weighted averages from USDC-USDT and BUSD-USDT spot markets.
3. **Orderbook Mark Price**\
   A TWAP of the mid-price on MUNE’s own orderbook.\
   Used in funding rate calculations and displayed as the “mark price” on the front end.

***

#### Oracle Usage in MUNE

* **Liquidation Calculations**\
  MUNE uses both the Spot Oracle Price and the Perpetual Index Price to determine trader account health and trigger liquidations when necessary.
* **Funding Rates**\
  Calculated using a TWAP of the Orderbook Mark Price and the Spot Oracle Price.\
  This mechanism aligns perpetual contract pricing with spot markets and ensures fair funding flows between long and short positions.
* **Redundancy Against Depegging**\
  An independent oracle feed for USDC is used to maintain accurate account valuation even in the event of a USDC depeg.\
  MUNE always displays prices quoted in USDC, not USD, and makes no assumption that 1 USDC = 1 USD.

***

Unlike purely on-chain oracle systems that suffer from infrequent updates due to gas constraints, Orderly’s hybrid oracle model provides high-frequency, cost-efficient, and secure price feeds. This enables MUNE to maintain CEX-grade performance while remaining decentralized and transparent.
