What it offers
- getLatestPrice: Read latest price from a Chainlink price feed aggregator
Notes
- Price feeds return answer in int256 with feed-specific decimals (usually 8 for USD pairs)
- Always check updatedAt timestamp for staleness - stale prices can cause issues
- Feed Registry is Ethereum-only; on L2s, use individual feed addresses directly
- VRF provides verifiable randomness for on-chain applications
- Common feed addresses vary by chain - check Chainlink docs for specific chain deployments
Its names in a program
On Ethereum,Chainlink is a namespace: its contracts need no import.
Deployments
ABI
AggregatorV3ABI
import AggregatorV3ABI from "./protocols/chainlink/AggregatorV3ABI.json"; Speaks for: ethUsdFeed.
latestRoundData() view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)decimals() view returns (uint8)
FeedRegistryABI
import FeedRegistryABI from "./protocols/chainlink/FeedRegistryABI.json"; Speaks for: feedRegistry.
latestRoundData(address base, address quote) view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)getFeed(address base, address quote) view returns (address aggregator)
Next steps
- Protocols: the other protocols, by what they do.
- Protocols and tokens: calling a contract by its namespace, or through its ABI.
- Glossary: the words these pages use, in plain terms.
