A set of minimal examples that, on a cron schedule (every 10 minutes), read from Chainlink Data Feeds using the CRE chain reader.
There are two types of examples:
1. Regular (single-value) price feeds
Reads decimals() and latestAnswer() from Chainlink Data Feeds (e.g. BTC/USD, ETH/USD), logs the scaled values, and returns a JSON array of results.
- Example network: Arbitrum One (mainnet).
Production contracts:
- BTC/USD on Arbitrum One: 0x6ce185860a4963106506C203335A2910413708e9
- ETH/USD on Arbitrum One: 0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612
2. MVR (Multiple Variable Response) bundle feeds
Reads latestBundle() and bundleDecimals() from a Chainlink BundleAggregatorProxy, decodes the returned bytes into multiple typed fields, and returns a structured JSON object (including scaled numeric values).
- Example network: Base mainnet.
- Example MVR feed: S&P Global SSA EURC.
References:
- Production MVR feed overview (S&P Global SSA EURC on Base): data.chain.link/feeds/base/base/sp-global-ssa-eurc
- BundleAggregatorProxy contract on Base: basescan.org/address/0xcF99622B5440a338f45daEE134d531A4BE64251F
- MVR decoding guide (Solidity / EVM)
Get Started
Language-specific examples (both regular and MVR) live under the building-blocks/read-data-feeds directory.
-
To get started with Go (regular data feeds), see the Go README.
-
To get started with TypeScript (regular data feeds), see the TypeScript README.
-
To get started with Go MVR bundle feeds, use the Go example that reads
latestBundle()/bundleDecimals()from the S&P Global SSA EURC feed on Base (see the corresponding Go README in the MVR example directory). -
To get started with TypeScript MVR bundle feeds, use the TypeScript example that reads and decodes the same MVR feed on Base (see the corresponding TypeScript README in the MVR example directory).
CREATED BY CHAINLINK LABS