LogoLogo
WebsiteTwitterGitHub
  • Introduction
    • Bridge
  • Wallets
    • fWallet
    • Rabby
    • MetaMask
    • Coinbase Wallet
    • Ledger
  • Staking
    • Overview
    • Stake FTM
    • Liquid Staking
    • Governance
  • Build on Opera
    • Overview
    • Tutorials
      • Deploy Contract
      • Verify Contract
      • Unit Test Contract
      • Create Fixed-Cap Asset
      • Create Variable-Cap Asset
      • Proxy Pattern
      • Diamond Proxy Pattern
    • Oracles
      • Chainlink
      • Band Protocol
      • API3
    • API
      • Public Endpoints
      • Transaction Tracing
      • Web3 API
      • GraphQL
        • Getting Started
        • Installation
        • Schema Basics
        • Schema Structure
        • Implementation Details
    • Providers
      • Contracts
        • Chainstack
        • thirdweb
        • GetBlock
      • API
        • The Graph
        • Covalent
        • Moralis
  • Funding
    • Gas Monetization
  • Run a Node
    • Overview
    • Node Providers
    • Mainnet
      • Run Validator Node
      • Run API Node
    • Testnet
      • Run Validator Node
      • Run Read-Only Node
    • Troubleshooting
    • FAQ
  • Technology
    • Overview
    • Consensus
    • Database Storage
    • Proof of Stake
    • Transaction Fees
    • Stablecoin
    • FAQ
  • Security
    • Contract Library
    • Fantom Safe
Powered by GitBook

© 2024 Fantom Foundation

On this page
  • Introduction
  • Supported Token Pairs
  • Opera Mainnet
  • Opera Testnet
  • Querying Prices
  • Solidity
Export as PDF
  1. Build on Opera
  2. Oracles

Chainlink

PreviousOraclesNextBand Protocol

Introduction

Chainlink enables smart contracts on Opera to leverage extensive off-chain resources, such as tamper-proof price data, verifiable randomness, external APIs, and much more. This documentation describes access to various cryptocurrency price data available to be integrated into decentralized applications running on Opera.

  • For implementation instructions, please refer to

  • For LINK token and faucet details, please refer to .

Note, off-chain equity and ETF assets are only traded during standard market hours (9:30 AM – 4:00 PM ET Monday–Friday). Using these feeds outside of those windows is not recommended.

Supported Token Pairs

Currently, the list of supported symbols can be found below. Going forward, this list will continue to expand based on developer needs and community feedback.

Opera Mainnet

Pair
Dec
Contract Address / Proxy

AAVE / USD

8

BNB / USD

8

BTC / USD

8

CREAM / USD

8

DAI / USD

8

ETH / USD

8

FTM / USD

8

LINK / USD

8

SNX / USD

8

SUSHI / USD

8

USDC / USD

8

USDT / USD

8

Opera Testnet

Pair
Dec
Contract Address / Proxy

BTC / ETH

18

BTC / USD

8

ETH / USD

8

FTM / USD

8

LINK / ETH

18

LINK / USD

8

USDT / USD

8

Querying Prices

Currently, there are two methods for developers to query prices from the Chainlink data feed: Through the Solidity PriceConsumer smart contract running on the hosting blockchain and through an external interface utilizing Chainlink AggregatorInterface ABI.

Solidity

pragma solidity ^0.6.7;

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

contract PriceConsumerV3 {

    AggregatorV3Interface internal priceFeed;

    /**
     * Network: Kovan
     * Aggregator: ETH/USD
     * Address: 0x9326BFA02ADD2366b30bacB125260Af641031331
     */
    constructor() public {
        priceFeed = AggregatorV3Interface(0x9326BFA02ADD2366b30bacB125260Af641031331);
    }

    /**
     * Returns the latest price
     */
    function getThePrice() public view returns (int) {
        (
            uint80 roundID, 
            int price,
            uint startedAt,
            uint timeStamp,
            uint80 answeredInRound
        ) = priceFeed.latestRoundData();
        return price;
    }
}

To consume price data, your smart contract should reference , which defines the external functions implemented by Price Feeds. The latest RoundData function returns five values representing information about the latest price data. See Price Feeds API Reference for more details.

Chainlink's documentation
LINK token contracts
AggregatorV3Interface
0xE6ecF7d2361B6459cBb3b4fb065E0eF4B175Fe74
0x6dE70f4791C4151E00aD02e969bD900DC961f92a
0x8e94C22142F4A64b99022ccDd994f4e9EC86E4B4
0xD2fFcCfA0934caFdA647c5Ff8e7918A10103c01c
0x91d5DEFAFfE2854C7D02F50c80FA1fdc8A721e52
0x11DdD3d147E5b83D01cee7070027092397d63658
0xf4766552D15AE4d256Ad41B6cf2933482B0680dc
0x221C773d8647BC3034e91a0c47062e26D20d97B4
0x2Eb00cC9dB7A7E0a013A49b3F6Ac66008d1456F7
0xCcc059a1a17577676c8673952Dc02070D29e5a66
0x2553f4eeb82d5A26427b8d1106C51499CBa5D99c
0xF64b636c5dFe1d3555A847341cDC449f612307d0
0x2a7e704E84d5093F3F31121D76A9b2343ccA13B8
0x65E8d79f3e8e36fE48eC31A2ae935e92F5bBF529
0xB8C458C957a6e6ca7Cc53eD95bEA548c52AFaA24
0xe04676B9A9A2973BCb0D1478b5E1E9098BBB7f3D
0xFE514ef0883F868fc2AE477A65e162f80CE9cD5D
0x6d5689Ad4C1806D1BA0c70Ab95ebe0Da6B204fC5
0x9BB8A6dcD83E36726Cc230a97F1AF8a84ae5F128