Skip to main content
Crypto markets resolve using oracle price feeds with Time-Weighted Average Price (TWAP) calculations. Oracle Infrastructure Primary: Pyth Network Fallback: Switchboard Both provide real-time, cryptographically signed price data for crypto assets.

TWAP Calculation

Markets resolve using a 15-minute Time-Weighted Average Price ending at market expiry. TWAP=i(pi×ti)/iti\text{TWAP} = \sum_{i} (p_i \times t_i) / \sum_{i}t_i Where:
  • pip_i is the price at data point ii
  • tit_i is the duration that the price was active
  • Window: 15 minutes ending at expiry TT
Example:
Value
Market”Will BTC close above $150,000 on Dec 31, 2025?”
ExpiryDec 31, 2025 23:59:59 UTC
TWAP Window23:45:00 – 23:59:59 UTC
If TWAP150000\text{TWAP} \ge 150000 → YES wins If TWAP<150,000\text{TWAP} < 150,000 → NO wins

Why TWAP?

Single-timestamp prices are manipulable. A 15-minute average requires sustained price movement, making flash loan attacks or brief manipulation ineffective.

Multi-Feed Protection

Final Price=Median(Pyth Price,Switchboard Price)\text{Final Price} = \text{Median}(\text{Pyth Price}, \text{Switchboard Price}) If PythSwitchboardMedian>2%\frac{|\text{Pyth} - \text{Switchboard}|}{\text{Median}} > 2\% : → Pause resolution → Alert admins → Manual review Cross-validation prevents single oracle failures.

Price Clamping

Maximum 1% price movement per minute during TWAP window. Outliers beyond 3 standard deviations are rejected.

Liveness Checks

TWAP window requires a minimum number of oracle updates (approximately 2 per minute = 30 updates for 15-minute window). If insufficient updates:
  • Check if oracle is down
  • If yes: extend window
  • If no: mark market invalid
I