Chainlink Data Feeds

Chainlink Data Feeds

Chainlink Data Feeds are the quickest way to connect your smart contracts to the real-world data such as asset prices and reserve balances.

Back

Overview

Chainlink Data Feeds are the quickest way to connect your smart contracts to the real-world data such as asset prices and reserve balances.

If you already started a project and need to integrate Chainlink, you can add Chainlink to your existing project with the @chainlink/contracts NPM package.

Data Feed Best Practices

Before you use Data Feeds, read and understand the best practices on the Selecting Quality Data Feeds page. For best practices about data for specific asset types, see the following sections:

Types of data feeds

Data feeds provide many different types of data for your applications.

Using Data Feeds on the Avalanche Primary Network

To consume price data, your smart contract should reference AggregatorV3Interface, which defines the external functions implemented by Data Feeds.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
 
import {AggregatorV3Interface} from "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol";
 
/**
 * THIS IS AN EXAMPLE CONTRACT THAT USES HARDCODED
 * VALUES FOR CLARITY.
 * THIS IS AN EXAMPLE CONTRACT THAT USES UN-AUDITED CODE.
 * DO NOT USE THIS CODE IN PRODUCTION.
 */
 
 
contract DataConsumerV3 {
    AggregatorV3Interface internal dataFeed;
 
    /**
     * Network: Avalanche Primary Network
     * Aggregator: AVAX/USD
     * Address: 0x0A77230d17318075983913bC2145DB16C7366156
     */
    constructor() {
        dataFeed = AggregatorV3Interface(
            0x0A77230d17318075983913bC2145DB16C7366156
        );
    }
 
    /**
     * Returns the latest answer.
     */
    function getChainlinkDataFeedLatestAnswer() public view returns (int) {
        // prettier-ignore
        (
            /* uint80 roundID */,
            int answer,
            /*uint startedAt*/,
            /*uint timeStamp*/,
            /*uint80 answeredInRound*/
        ) = dataFeed.latestRoundData();
        return answer;
    }
}

Primary Network Price Feed Addresses

StatusPairContract AddressAsset NameAsset TypeMarket Hours
🟢AAVE / USD0x3CA13391E9fb38a75330fb28f8cc2eB3D9ceceEDAaveCryptoCrypto
🔵AAVE Network Emergency Count (Avalanche)0x41185495Bc8297a65DC46f94001DC7233775EbEeN/AN/AN/A
🟢ADA / USD0x69C2703b8F1A85a2EF6aBDd085699a9F909BE053CardanoCryptoCrypto
🟡ALPHA / USD0x7B0ca9A6D03FE0467A31Ca850f5bcA51e027B3aFAlpha FinanceCryptoCrypto
🟢AVAX / USD0x0A77230d17318075983913bC2145DB16C7366156AvalancheCryptoCrypto
🟡AXS / USD0x155835C5755205597d62703a5A0b37e57a26Ee5CAxie InfinityCryptoCrypto
🟡BAT / USD0xe89B3CE86D25599D1e615C0f6a353B4572FF868DBasic Attention TokenCryptoCrypto
🟠BEAM / USD0x3427232b88Ce4e7d62A03289247eE0cA5324f6baBeamCryptoCrypto

Primary Network Proof of Reserve Addresses

StatusAssetContract AddressReserve TypeData SourceReporting/Auditor
🔵AAVE.e PoR0x14C4c668E34c09E1FBA823aD5DB47F60aeBDD4F7Cross-chainCross-chainWallet address
🔵BTC.b PoR0x99311B4bf6D8E3D3B4b9fbdD09a1B0F4Ad8e06E9Cross-chainCross-chainWallet address
🔵DAI.e PoR0x976D7fAc81A49FA71EF20694a3C56B9eFB93c30BCross-chainCross-chainWallet address
🔵Ion Digital Total Reserve0x121C188f76831f504bD29C753074B37a4177cEc3Off-chainInstruxiThird-party auditor
🔵LINK.e PoR0x943cEF1B112Ca9FD7EDaDC9A46477d3812a382b6Cross-chainCross-chainWallet address
🔵USDC.e PoR0x63769951E4cfDbDC653dD9BBde63D2Ce0746e5F2Cross-chainCross-chainWallet address
🔵USDT.e PoR0x94D8c2548018C27F1aa078A23C4158206bE1CC72Cross-chainCross-chainWallet address
🔵WBTC.e PoR0xebEfEAA58636DF9B20a4fAd78Fad8759e6A20e87Cross-chainCross-chainWallet address

Primary Network Rate and Volatility Feed Addresses

AssetContract Address
BTC-USD 30-Day Realized Vol0x93b9B82158846cefa8b4040f22A3Bff05c365226
ETH-USD 30-Day Realized Vol0x89983A2FDd082FA40d8062BCE3986Fc601D2d29B

Developer:

Chainlink Labs

Categories:

Data Feeds

Available For:

C-Chain

Website:

https://chain.link/

Documentation:

https://chain.link/data-feeds
Edit on Github