System Overview
On-Chain Components
Orica Program
Program ID:
oEarJ8xDDssLcWwgkSpRVVbmiUyeDnoHFNAHPp6eetwHandles:- Market creation
- Trading (buy/sell)
- Redemption
- Fee collection
Disputes Program
Program ID:
oVEzkDiY2FZP4ADfCeUfrg8jgCoMnPcVQao99indSqNHandles:- Dispute initiation
- Weighted voting
- Message posting
- Resolution override
Account Types
Off-Chain Components
Indexer Service
The indexer continuously monitors the Solana blockchain for:- New markets created
- Trades executed
- Market resolutions
- Dispute activity
The indexer uses Solana’s WebSocket subscription to receive updates in real-time, typically within 1-2 seconds of block confirmation.
Public API
The API provides:- REST endpoints: Query markets, trades, disputes, and analytics
- WebSocket streams: Real-time price updates and trade activity
AI Resolution System
The auto-resolver is a multi-agent AI daemon that monitors closed markets and autonomously determines outcomes: Key characteristics:- Parallel Processing: Up to 100 markets resolved simultaneously via semaphore-controlled concurrency
- Hierarchical Agents: Primary orchestrator delegates to specialized sub-AI workers for scraping
- Multi-Format Extraction: Sub-crawlers support markdown, JSON schemas, screenshots, and link discovery
- Agentic Loops: Orchestrator runs up to 20 iterations; sub-AI scrapers run up to 5 iterations each
- Immutable Proofs: Full reasoning chains persisted to IPFS via Pinata
Data Flow
1
User Signs Transaction
A user’s wallet signs a transaction (e.g., buy shares) and broadcasts it to Solana.
2
Program Executes
The Orica program validates the instruction, updates market state, and transfers tokens.
3
Indexer Receives Update
The indexer’s WebSocket subscription receives the confirmed transaction.
4
Database Updated
The indexer parses the transaction, extracts relevant data, and writes to PostgreSQL.
5
API Serves Data
Clients query the API and receive the updated data with low latency.
Why Use the API?
Querying Solana directly has limitations:- No complex queries: Can’t sort, filter, or aggregate efficiently
- No historical data: Account state only shows current values
- Rate limits: RPC nodes have strict call limits
- Latency: Multiple RPC calls required for complete data
- Pre-computed aggregations (volume, trade count)
- Historical snapshots (price history, trade history)
- Efficient pagination and filtering
- WebSocket streams for real-time updates
Security Model
Next Steps
On-Chain Programs
Deep dive into program instructions.
Indexer
Learn how the indexer processes data.