What composability enables, where the risk actually concentrates, and the failure modes that only appear once protocols stack.
Oracle is a bridge between blockchains and external data sources. Since smart contracts can't access off-chain data, oracles fetch and verify real-world information like prices, weather, or sports results.
Why Oracles Are Needed
Smart contracts are:
- Isolated from external systems
- Deterministic (same input = same output)
- Unable to make API calls directly
Oracles solve this by:
- Fetching external data
- Verifying authenticity
- Delivering on-chain
- Enabling smart contracts to react to real events
Types of Oracles
- Fetch external data
- Most common type
- Example: Price feeds
Output Oracles
- Send blockchain data externally
- Enable off-chain actions
- Example: Payment triggers
- Bridge data between chains
- Enable interoperability
- Example: LayerZero
Compute-enabled Oracles
- Perform off-chain computation
- Return results on-chain
- Example: Verifiable random numbers
Popular Oracle Networks
| Oracle | Use Case | Chains |
|---|
| Chainlink | Price feeds, VRF | Multi-chain |
| Pyth | High-frequency prices | Solana, multi |
| Band Protocol | Data feeds | Cosmos, multi |
| UMA | Optimistic oracles | Ethereum |
| API3 |
Oracle Use Cases
- Price feeds for lending/borrowing
- Liquidation triggers
- DEX price discovery
Insurance
- Weather data for crop insurance
- Flight delays for travel insurance
- Natural disaster verification
Gaming
- Verifiable randomness
- Sports scores
- Tournament results
Supply Chain
- GPS tracking
- IoT sensor data
- Customs verification
Oracle Risks
- Centralization: Single point of failure
- Data manipulation: Flash loan attacks
- Latency: Delayed data delivery
- Cost: Expensive to use frequently
Oracle Security
Good oracles use:
- Multiple data sources
- Decentralized node networks
- Cryptographic proofs
- Economic incentives for honesty
- Reputation systems