Prediction Market Oracle Feeds
Summary
Prediction markets rely on reliable price/oracle feeds for resolution and for building signals. Current oracle-data-feed.js exists with fixture data. This finding identifies robust oracle sources for crypto/market data (Chainlink, Pyth Network, UMA), their reference endpoints/feeds, and practical integration points for Stream 5 (Prediction) to improve accuracy and reduce reliance on deprecated fixtures.
Key Findings
- Chainlink Price Feeds: Canonical price feed addresses per network (Base, Arbitrum, Ethereum). Use aggregator contracts for major pairs; verify feed addresses against official references. Some legacy endpoints seen deprecated; prefer on-chain feed resolution.
- Pyth Network: Pull-based oracle delivering real-time prices via price feeds with confidence intervals. Supports wide range of assets and frequent updates; useful for high-frequency signals. Offers both on-chain (Solidity) and off-chain APIs; Hermes API provides latest prices and metadata.
- UMA Optimistic Oracles (OO): Dispute-based oracles suitable for event-based resolutions (e.g., election outcomes, sport results) common in prediction markets. Allows proposers to assert outcomes with liveness/dispute period; critical for market settlement.
- Integration considerations: Validate addresses, check staleness (
isPriceStaleexists), aggregate multiple sources to avoid single point of failure, and prefer canonical addresses from official registries. - Data freshness: Oracle updates vary (Chainlink heartbeat varies by feed, Pyth updates on price change). Need staleness thresholds per asset class.
Recommendations
Rec 1 (Stream 5): Extend
oracle-data-feed.js to support Pyth (Hermes/latest price endpoints) and UMA assertions as optional providers, keeping Chainlink as canonical default. Label all external data as fixtures when offline.Rec 2 (addresses): Pin canonical oracle feed addresses in
streams/shared/addresses.js (or extend oracle module) validated by viem.isAddress; never guess endpoints. Cross-reference against official Chainlink feed lists and Pyth price feed IDs.Rec 3 (robustness): Enhance
aggregatePrices() to weight by confidence/staleness and detect deviations (findPriceDeviation exists) with configurable thresholds per market type.Rec 4 (prediction markets): For Polymarket integration, prefer UMA-based resolution feeds where applicable; document when to use push vs pull oracles.
Impact on Streams / Todos
- Stream 5 (Prediction): improves s5-todo-003 (oracle data feed system) accuracy and resilience; strengthens s5-todo-002 (Polymarket integration) by improving resolution signal quality.
- Infra: complements existing research integration (infra-todo-006) with concrete oracle provider expansion.
Sources
Unblocks
infra-todo-006 s5-todo-002 s5-todo-003