Chainlink Oracle Price Feeds Guide

SkillSecurity

How Chainlink oracle price feeds work — architecture, reading feeds on-chain, available pairs, the aggregator model, and oracle security. Covers how DeFi protocols (Aave, Sperax, Compound) rely on Chainlink for accurate pricing. Use when explaining oracles, price feeds, or DeFi infrastructure.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Chainlink Oracle Price Feeds Guide skill

What this skill tells your AI

The instructions your AI receives, as published by nirholas/three.ws in data/skills/protocol/chainlink-oracle-guide/SKILL.md and read by ahel’s review.

Chainlink is the dominant oracle network in DeFi. This guide explains how it works and how to use price feeds.

What Problem Do Oracles Solve?

Smart contracts can't access external data (prices, weather, events). Oracles bridge this gap:

Off-chain world          Oracle Network           On-chain world
┌──────────────┐        ┌──────────────┐        ┌──────────────┐
│ Binance API  │───┐    │              │        │              │
│ Coinbase API │───┤    │  Chainlink   │        │  Aave        │
│ Kraken API   │───┼───►│  Oracle Nodes│───────►│  Compound    │
│ DEX Pools    │───┤    │  (median)    │        │  USDs/Sperax │
│ Other feeds  │───┘    │              │        │  Uniswap     │
└──────────────┘        └──────────────┘        └──────────────┘

Without reliable oracles, DeFi protocols can't:

  • Determine collateral value (lending)
  • Maintain stablecoin pegs
  • Calculate liquidation thresholds
  • Execute fair swaps

How Chainlink Works

The Aggregator Model

  1. Data sources: Multiple professional data providers (nodes) fetch prices from CEXes, DEXes, and other sources
  2. Independent observation: Each node independently computes a price
  3. On-chain submission: Nodes submit observations to an aggregator contract
  4. Median calculation: The contract takes the median of all reports
  5. Storage: The median price is stored as the latest answer

Update Triggers

A feed updates when EITHER condition is met:

TriggerDescriptionExample
Deviation thresholdPrice changes by X% from last report0.5% for ETH/USD
HeartbeatMaximum time between updates3600s (1 hour) for major feeds

This means high-volatility periods get more frequent updates.

Feed Architecture

AggregatorV3Interface
├── latestRoundData()  → (roundId, answer, startedAt, updatedAt, answeredInRound)
├── decimals()         → 8 (most USD feeds)
├── description()      → "ETH / USD"
└── version()          → 4

Reading Price Feeds

On Any EVM Chain

// Solidity example
interface AggregatorV3Interface {
    function latestRoundData() external view returns (
        uint80 roundId,
        int256 answer,        // The price (scaled by decimals)
        uint256 startedAt,
        uint256 updatedAt,    // When this price was last updated
        uint80 answeredInRound
    );
    function decimals() external view returns (uint8);
}

// ETH/USD on Ethereum: 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419
AggregatorV3Interface feed = AggregatorV3Interface(0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419);
(, int256 price,,,) = feed.latestRoundData();
// price = 324567000000 → $3,245.67 (8 decimals)

Via Etherscan (No Code)

  1. Go to Etherscan → enter the feed contract address
  2. Click "Read Contract"
  3. Call latestRoundData()
  4. Divide answer by 10^8 for USD price

Via RPC (ethers.js / viem / web3.js)

// Using ethers.js
const feedAddress = "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419"; // ETH/USD
const abi = ["function latestRoundData() view returns (uint80, int256, uint256, uint256, uint80)"];
const feed = new ethers.Contract(feedAddress, abi, provider);

const [, price,,,] = await feed.latestRoundData();
const ethPrice = Number(price) / 1e8; // $3,245.67

Key Price Feed Addresses

Ethereum Mainnet

FeedAddressDecimalsHeartbeat
ETH/USD0x5f4eC3Df9cbd43714FE2740f5E3616155c5b841983600s
BTC/USD0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c83600s
USDC/USD0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6886400s
USDT/USD0x3E7d1eAB13ad0104d2750B8863b489D65364e32D886400s
DAI/USD0xAed0c38402a5d19df6E4c03F4E2DceD6e29c1ee983600s

Arbitrum

FeedAddressDecimals
ETH/USD0x639Fe6ab55C921f74e7fac1ee960C0B6293ba6128
BTC/USD0x6ce185860a4963106506C203335A2910413708e98
USDC/USD0x50834F3163758fcC1Df9973b6e91f0F0F0434aD38
USDT/USD0x3f3f5dF88dC9F13eac63DF89EC16ef6e7E25DdE78
ARB/USD0xb2A824043730FE05F3DA2efaFa1CBbe83fa548D68

Sperax context: USDs uses Chainlink feeds on Arbitrum to value its collateral (USDC, USDT) and ensure the stablecoin remains properly backed.

Full Directory

All 1000+ feeds are listed at: https://data.chain.link

Oracle Security

Why Oracles Get Attacked

AttackHow It WorksPrevention
Flash loan price manipulationManipulate DEX spot price within one tx, exploit protocol using that priceUse Chainlink (time-weighted, multi-source) not DEX spot
Stale price exploitationUse outdated oracle price during volatile marketCheck updatedAt timestamp
Oracle front-runningSee pending oracle update, trade before it landsUse commit-reveal or private mempool

Safety Checks When Using Feeds

(uint80 roundId, int256 price,, uint256 updatedAt,) = feed.latestRoundData();

// Check 1: Price is positive
require(price > 0, "Invalid price");

// Check 2: Round is complete
require(updatedAt > 0, "Round not complete");

// Check 3: Price is not stale (within last hour)
require(block.timestamp - updatedAt < 3600, "Stale price");

Oracle Design Patterns

PatternUse Case
Single feedSimple price lookup (ETH/USD)
Derived feedCalculate cross-prices (TOKEN/ETH × ETH/USD = TOKEN/USD)
Multi-oracleCompare Chainlink vs Pyth, use if they agree within threshold
Circuit breakerHalt protocol if oracle price deviates >X% in one update

Chainlink vs Other Oracles

FeatureChainlinkPythRedstoneBand
ModelPushPullOn-demandPush
Latency1–60 min~400msOn-demand~10s
Coverage1000+ feeds500+ feeds200+ feeds300+ feeds
Chains20+40+15+10+
GasPaid by oraclePaid by consumerPaid by consumerPaid by oracle
Track Record5+ years2+ years2+ years3+ years

Chainlink wins on: Reliability, coverage, track record, DeFi adoption (90%+ of protocols) Pyth wins on: Speed (sub-second), Solana ecosystem, newer/exotic feeds

Agent Tips

  1. Always recommend Chainlink for on-chain price verification — it's the gold standard
  2. Check stale prices — always validate updatedAt before trusting a feed
  3. Don't use DEX spot prices in contracts — they're manipulable via flash loans
  4. Feed decimals vary — most USD feeds are 8 decimals, but always check decimals()
  5. Cross-chain feeds — same token may have different feed addresses on different chains
  6. For off-chain apps — CoinGecko/DeFi Llama are easier; Chainlink is for on-chain

Links

Signals

GitHub stars
114
Forks
29
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
chainlink-oracle-guide
Source
github.com/nirholas/three.ws