Price Feed Mechanics

Chainlink's price feeds work by having multiple independent nodes fetch prices from different data sources (exchanges, data providers). Each node submits an answer on-chain, and the aggregator contract takes the median — making it resistant to any single source being wrong or manipulated. Updates are triggered by deviation thresholds or heartbeat timers.

📊 Node Aggregation Simulator

Median Price
$2,000.00
Deviation from True
0.00%
Node Spread
$20.00
Update Triggered?
No

⏱️ Push vs Pull Oracle Models

Push (Chainlink)
How: Nodes push updates to on-chain aggregator
When: Deviation > threshold OR heartbeat timer expires
Cost: Protocol pays gas for every update
Latency: Seconds to minutes
Best for: Lending, stablecoins (infrequent reads OK)
Pull (Pyth)
How: Users pull latest price into their transaction
When: On-demand, every transaction if needed
Cost: User pays gas for their tx (cheaper per-update)
Latency: Sub-second (400ms)
Best for: Perps, high-frequency DeFi

🔧 Update Triggers

📐
DEVIATION THRESHOLD
Price moves >0.5-1% from last on-chain value → trigger update. Common: 0.5% for ETH/USD, 1% for smaller assets.
💓
HEARTBEAT
Even if price hasn't moved, update every N seconds. Common: 3600s (1h) for major pairs. Ensures liveness.
🔢
MINIMUM RESPONSES
Require at least N of M nodes to respond before accepting a round. Prevents stale data from too few reporters.