MVR Feeds API Reference

When you use MVR Feeds, you typically retrieve the data through the IBundleAggregatorProxy interface and the proxy contract address. This interface combines functions from both IBundleBaseAggregator and ICommonAggregator. If the aggregator behind the proxy changes, your consumer contract remains compatible as long as you interact through the proxy interface.

To see detailed examples of how to integrate these functions, refer to the Using MVR Feeds on EVM Chains (Solidity) guide.

IBundleAggregatorProxy

IBundleAggregatorProxy extends both IBundleBaseAggregator and ICommonAggregator. In addition, it provides functions to manage or view the underlying aggregator reference.

A minimal example showing how to set the proxy address and call these functions in your consumer contract:

import { IBundleAggregatorProxy } from "./interfaces/IBundleAggregatorProxy.sol";

contract MyMVRConsumer {
    IBundleAggregatorProxy public proxy;

    constructor(address _proxyAddress) {
    proxy = IBundleAggregatorProxy(_proxyAddress);
    }

    function readLatestData() external view returns (bytes memory, uint256) {
    // Retrieve the latest bundle as raw bytes
    bytes memory bundle = proxy.latestBundle();
    // Get the timestamp of the latest update
    uint256 timestamp = proxy.latestBundleTimestamp();
    return (bundle, timestamp);
    }
}

Functions in IBundleAggregatorProxy

NameDescription
proposedAggregatorReturns the address of the aggregator that is proposed to replace the current aggregator, but not yet confirmed.
confirmAggregatorConfirms a new aggregator address. Typically, only the owner or an authorized entity can call this.
aggregatorReturns the address of the currently confirmed aggregator behind the proxy.
latestBundleReturns the most recent data bundle as a bytes array.
bundleDecimalsReturns an array of decimals that match each numeric field in the bundle. Non-numeric fields typically have 0.
latestBundleTimestampReturns the timestamp of the most recent data bundle.
descriptionA short description of the underlying aggregator or feed.
versionReturns a version number for the aggregator.

proposedAggregator

function proposedAggregator() external view returns (address);

Returns the address of the aggregator that is proposed to replace the current aggregator. This aggregator is not active until it is confirmed.

confirmAggregator

function confirmAggregator(address aggregatorAddress) external;

Confirms a new aggregator contract address. Only authorized addresses can typically call this function.

  • Parameters:
    • aggregatorAddress: The address of the new aggregator to confirm.

aggregator

function aggregator() external view returns (address);

Returns the address of the currently confirmed aggregator behind the proxy.

latestBundle

function latestBundle() external view returns (bytes memory bundle);

Returns the most recent data bundle as a bytes array. You can decode this bundle according to the known structure for your specific MVR feed.

bundleDecimals

function bundleDecimals() external view returns (uint8[] memory);

Returns an array of decimals for the numeric fields of the data bundle. Fields of other types, such as bool, typically have a corresponding decimal value of 0.

latestBundleTimestamp

function latestBundleTimestamp() external view returns (uint256);

Returns the timestamp (block time) of the most recent update to the data bundle.

description

function description() external view returns (string memory);

Returns a short description of the underlying aggregator or feed.

version

function version() external view returns (uint256);

Returns the version number of the aggregator behind the proxy.


IBundleBaseAggregator

IBundleBaseAggregator defines the core functions for reading multiple-variable data from an onchain aggregator. These functions are inherited by IBundleAggregatorProxy.

Functions in IBundleBaseAggregator

NameDescription
latestBundleReturns the most recent data bundle as a bytes array.
bundleDecimalsReturns the array of decimals corresponding to each numeric field.
latestBundleTimestampReturns the timestamp of the most recent data bundle.

latestBundle

function latestBundle() external view returns (bytes memory bundle);

Returns the latest encoded bundle data as a bytes array.

bundleDecimals

function bundleDecimals() external view returns (uint8[] memory);

Returns an array of decimals where each entry corresponds to a numeric field in the bundle. Non-numeric fields might have a value of 0.

latestBundleTimestamp

function latestBundleTimestamp() external view returns (uint256);

Returns the block timestamp of the most recent data bundle.


ICommonAggregator

ICommonAggregator provides common metadata functions for aggregator contracts, such as a human-readable description and a version number.

Functions in ICommonAggregator

NameDescription
descriptionA string describing the underlying aggregator.
versionReturns a numeric version identifier for the aggregator.

description

function description() external view returns (string memory);

Returns a description string for the feed or aggregator.

version

function version() external view returns (uint256);

Returns a numeric value representing the aggregator version.

Get the latest Chainlink content straight to your inbox.