beginner
+150 XP

Oracle Architecture & Price Feeds

Deep dive into OracleSVI β€” how oracles store market state, how Pyth Lazer delivers real-time prices, and how strike grids define valid trading levels.

Lesson Syllabus

The OracleSVI Object
πŸ“Š

OracleSVI Data Structure

Each market is represented by an OracleSVI shared object on-chain. It stores everything needed to price and settle a market: the underlying asset, expiry timestamp, price data, SVI volatility parameters, and settlement state.

πŸ”„

Oracle Lifecycle Transitions

Oracles follow a strict state machine. Understanding transitions is critical β€” calling mint on a non-active oracle will abort the transaction.

πŸ“‘

Oracle Events for Real-Time Data

Oracles emit on-chain events at every state change. Your dApp can subscribe to these events via Sui checkpoint streaming for low-latency updates, or poll the predict-server REST API.

Price Feeds & Pyth Lazer
πŸ’Ή

Spot, Forward, and Basis

The oracle tracks three related price concepts. Spot is the current market price. Forward is the expected price at expiry. Basis is the ratio forward/spot β€” it captures carry cost and expected drift.

πŸ“

SVI Parameters

The SVI (Stochastic Volatility Inspired) model uses five parameters to define an implied volatility smile. These are published by Block Scholes (an institutional options analytics firm) and stored directly on the oracle.

πŸ—‚οΈ

Three-Tier Data Access

A production dApp uses three tiers for data access: the predict-server REST API for market data, Sui event subscriptions for real-time updates, and direct on-chain reads for transaction confirmation.

Strike Grids
πŸ“

How Strike Grids Work

Each oracle defines a grid of valid strikes starting at min_strike and spaced by tick_size. You can only trade at these discrete price levels β€” they ensure orderly markets and efficient exposure tracking.

πŸŽ›οΈ

Strike Selection UI Pattern

In a trading dApp, users select strikes from the grid. You typically show strikes around the current spot price, with the at-the-money (ATM) strike highlighted. The fair price varies by strike β€” further from forward = cheaper.

🌐

The Predict Server API

The predict-server provides indexed, queryable market data. It runs alongside the Sui blockchain and serves REST endpoints for oracle discovery, price history, position tracking, and vault analytics.