Multiple-Variable Response (MVR) Feeds
Multiple-Variable Response (MVR) feeds bundle multiple data points into a single onchain update, offering more versatility compared to feeds that store only one numeric value.
Traditional Chainlink Data Feeds typically provide a single numeric value such as a price. By contrast, MVR feeds can return multiple values of different types in a single update, including both numeric and non-numeric data.
Key Benefits
-
Multiple Data Points: Package related data together in one feed. For example, an investment fund feed might include:
Field Type netAssetValue
uint256
assetsUnderManagement
uint256
outstandingShares
uint256
netIncomeExpenses
uint256
openToNewInvestors
bool
-
Extensibility: The feed structure can be extended or updated without deploying a new contract.
-
Efficiency: Multiple data points update in a single transaction.
-
Flexible Types: Support for various data types beyond just numbers.
Reading MVR Feed Data
MVR feeds use the BundleAggregatorProxy
contract as their interface, which provides three key functions:
latestBundle()
: Returns the complete data bundle as a bytes arraybundleDecimals()
: Returns the decimal places for each numeric fieldlatestBundleTimestamp()
: Returns when the data was last updated
To use these feeds in your smart contracts, you'll need to:
- Obtain the
BundleAggregatorProxy
address for your desired feed from the SmartData addresses page (use the Show Multiple-Variable Response (MVR) feeds checkbox to filter the list) - Retrieve the data using
latestBundle()
- Decode the bytes array into the appropriate structure
Note: MVR feeds only store the most recent data onchain. If you need historical data, you must capture it within your own contract or through an offchain indexer.
Check our implementation guides for detailed instructions on integrating MVR feeds using Solidity, ethers.js, or Viem.
Resources
- SmartData Addresses: Find
BundleAggregatorProxy
addresses and data structures for available MVR feeds. - MVR Feeds API Reference: Complete interface definitions and function signatures.
- Implementation Guides:
- Solidity Guide: For smart contract developers using Solidity
- ethers.js Guide: For frontend or Node.js developers using ethers.js v5
- Viem Guide: For TypeScript developers using the Viem library