A blockchain oracle is a service that connects smart contracts to data sources outside the blockchain. Since blockchains cannot natively access external information, oracles act as the bridge between on-chain and off-chain worlds, feeding real-world data into decentralized applications.
Oracles are critical to DeFi because most financial protocols need accurate, real-time price data. A lending platform, for example, must know current token prices to determine when a position should be liquidated. Without reliable oracles, these protocols simply could not function.
There are several types of oracles:
- Price feed oracles — deliver real-time asset prices to DeFi protocols (Chainlink is the most widely used)
- Computation oracles — perform complex calculations off-chain and deliver results on-chain
- Cross-chain oracles — relay data between different blockchain networks
- Inbound oracles — bring external data on-chain (market prices, weather data)
- Outbound oracles — allow smart contracts to trigger off-chain actions
The biggest risk with oracles is the oracle problem — if the data fed into a smart contract is incorrect or manipulated, it can lead to devastating consequences. Oracle manipulation attacks have been used to drain millions from dApps by providing false price data.
Decentralized oracle networks like Chainlink address this by aggregating data from multiple independent sources, reducing the risk of any single point of failure. When evaluating a DeFi protocol, always check which oracle solution it uses and how robust its data feeds are.