Chainlink

Introduction

Chainlink data feeds are the quickest way to connect your smart contracts to oracle data, such as asset prices.

Chainlink is implemented as a smart contract on Neon EVM, making Chainlink data feeds from the Solana network available for smart contracts to consume.

Each Chainlink feed is available via its own contract. To use a feed, you create a "hybrid" smart contract, i.e. you build the integration with the feed contract into your own smart contract and deploy that. Learn more from Chainlink's documentation.

Deployed feeds

The Chainlink controller contract is deployed on Devnet. This contract implements the AggregatorV3Interface to support the following feeds:

Mainnet

Currency pair
Chainlink contract feed address

BTC/USD

0xxxxxxx

BNB/USD

0xxxxxxx

ETH/USD

0xxxxxxx

OP/USD

0xxxxxxx

SOL/USD

0xxxxxxx

USDC/USD

0xxxxxxx

USDT/USD

0xxxxxxx

Boilerplate contract

SPDX-License-Identifier: MIT
pragma solidity 0.8.21;

import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";


contract TestChainlink {
    /**
     * Returns the latest price for specific price feed
     */
    function getLatestPrice(address _priceFeed) external view returns (int) {
        (
            /* uint80 roundID */,
            int price,
            /*uint startedAt*/,
            /*uint timeStamp*/,
            /*uint80 answeredInRound*/
        ) = AggregatorV3Interface(_priceFeed).latestRoundData();
        return price;
    }

    /**
     * Returns the decimals for specific price feed
     */
    function getDecimals(address _priceFeed) external view returns (uint8) {
        return AggregatorV3Interface(_priceFeed).decimals();
    }
}

Last updated