Yusnee
Yusnee

Reputation: 187

How to get KCC pricefeed using chainlink

I have done with several price feed Aggregator using @chainlink. Now I am working on KCC and need the price feed as well.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

contract PriceTest {
    AggregatorV3Interface internal priceFeed;
    
    constructor()  { 
    priceFeed = AggregatorV3Interface(0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE); // for BSC Main Net
   
    priceFeed = AggregatorV3Interface(0xcf0f51ca2cDAecb464eeE4227f5295F2384F84ED); // for Rinkeby
    
    priceFeed = AggregatorV3Interface(0xd0D5e3DB44DE05E9F294BB0a3bEEaF030DE24Ada); // for mumbai tesnet
   
    // KCC test Net and KCC Mainnet.....????

    }
 
   function getLatestPrice() public view returns (uint256) {
        (,int price,,,) = priceFeed.latestRoundData();
        return uint256(price);
    }       
}

Upvotes: 1

Views: 99

Answers (1)

Zak Ayesh
Zak Ayesh

Reputation: 631

There are currently no data feeds supporting KCC pairs. Addresses for currently supported price pairs can be found in the Chainlink docs. If there is no data feed for a currency pair you can try the following steps:

  1. Request the Chainlink Labs help you in creating a data feed by completing the form opened after clicking "Launch your price feed" button on the official website.
  2. Use Chainlink's AnyAPI solution, until a data feed is available.
  3. Create your own data feed, although this is not currently supported in the docs (for now).

Upvotes: 1

Related Questions