Chainlink Price Feeds
Chainlink price feeds are the backbone of DeFi - over 1,000 protocols rely on them for accurate, tamper-proof price data. Each feed is powered by a Decentralized Oracle Network (DON) where independent node operators fetch prices from premium data providers, aggregate off-chain, and deliver the result on-chain.
Oracle Network Visualization
Watch oracle nodes fetch price data from sources, aggregate off-chain, and deliver the median price to the on-chain aggregator. Adjust the number of nodes and deviation threshold.
Price Update Timeline
Simulated price feed showing when on-chain updates occur based on deviation threshold and heartbeat timing.
How Price Aggregation Works
With Off-Chain Reporting (OCR), nodes communicate peer-to-peer to reach consensus off-chain. Only one transaction is submitted with all node signatures, reducing gas costs by up to 90% compared to on-chain aggregation.
The aggregator computes the median of all valid node responses. The median is resistant to outliers - even if a few nodes report bad data, the final price remains accurate. This is why odd numbers of nodes are preferred.
* Update Triggers
When the off-chain aggregated price deviates from the last on-chain value by more than the threshold (e.g., 0.5%), an update is triggered immediately. Critical for volatile markets.
Even if the price is stable, a heartbeat update occurs at regular intervals (e.g., every 3600s). This guarantees freshness and lets consumers verify the feed is still active.
Smart contracts should always check the updatedAt timestamp. If the feed is stale (older than heartbeat + buffer), the protocol should pause or use a fallback oracle.