KCC Oracle

Overview

A blockchain oracle is a bridge between the blockchain and the real world. These oracles allow real-world data to enter the blockchain. This data could be anything from price information to weather reports. Oracles can also be bi-directional and "send" data out to the real world. With the sharp rise of various DeFi applications, a stable and reliable decentralized oracle service is key to premium DeFi projects. Hence, the arrival of KCC Oracle addresses the need for KCC-based smart contracts to access external data. Please read through them carefully and understand the underlying risks before using Oracle.

Reliability

Data Sources

KCC Oracle sources price data from multiple centralized exchanges (CEXs) and from the decentralized finance (DeFi) applications and aggregates the data using a weighted formula.

Data Signing

KCC Oracle has two roles: transmitter and signer. The signer signs data, and the transmitter is responsible for transmitting the signed data up the chain. It is intended to make data tamper-proof and to improve the security and reliability of different roles addresses.

Data Publishing

Publishing data to the blockchain happens through multi-nodes. Multi-nodes also ensure that those smart contracts that already store some data are secure and audited. Multi-node architecture can also adjust the frequency of data publishing based on the situation. For example, it can help you get accurate data during high price volatility.

Data Monitoring

The data on the KCC Oracle is kept up to date by an independent monitoring service that works 24 hours a day, seven days a week. It fetches prices from different data sources and compares them to published blockchain data. And the KCC Oracle support team will intervene if a significant deviation is detected.

API Reference

Oracle Aggregator periodically publishes valuable data to the Oracle network. The aggregator stores the aggregated data on a chain so that consumers can retrieve and use it in the same transaction. We recommend retrieving data sources through AggregatorV3Interface and proxy addresses.

Functions

decimals

Get the number of decimals of the response

function decimals() external view returns (uint8);

Return values

  • RETURN: The number of decimals

description

Get the description of the aggregator

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

Return values

  • RETURN: The description of trading pairs

getRoundData

Get the round data details for a given round ID

function getRoundData(uint80 _roundId)
  external
  view
  returns (
    uint80 roundId,
    int256 answer,
    uint256 startedAt,
    uint256 updatedAt,
    uint80 answeredInRound
  );

Parameters

  • _roundId: The round ID

Return values

  • roundId: The round ID

  • answer: The answer for this round

  • startedAt: Timestamp of when the round started

  • updatedAt: Timestamp of when the round was updated

  • answeredInRound: The round ID in which the answer was computed

latestRoundData

Get the price from the latest round

function latestRoundData() external view
    returns (
        uint80 roundId,
        int256 answer,
        uint256 startedAt,
        uint256 updatedAt,
        uint80 answeredInRound
    );

Return values

  • roundId: The round ID

  • answer: The price

  • startedAt: Timestamp of when the round started

  • updatedAt: Timestamp of when the round was updated

  • answeredInRound: The round ID of the round in which the answer was computed

version

Get the version of the aggregator

function version() external view returns (uint256);

Return values

  • RETURN: The version of the aggregator

Contract Address

KCC Mainnet Feed addresses

KCC Testnet Feed addresses

Last updated