メインコンテンツまでスキップ

PriceFeed, Decentralized Oracle for Aggregating and Providing Asset Price Data

CIP-104Category: CBCTag: DRAFT約3分

CIP-104: PriceFeed, Decentralized Oracle for Asset Price Data

Abstract

This CIP introduces the "PriceFeed" contract, designed to act as a decentralized oracle for aggregating and providing asset price data. It allows authorized nodes to submit aggregated price data that is made available for other contracts to consume. This contract is crucial for applications that require reliable and up-to-date asset price information, such as stable coins, synthetic assets, and various DeFi platforms.

Motivation

The motivation behind the PriceFeed contract is to provide a reliable, decentralized source of asset price data that smart contracts can use. In many DeFi applications, accurate and timely price information is crucial for collateralization, liquidation, and synthetic asset pricing. The PriceFeed contract aims to fulfill this need by aggregating price data from multiple authorized sources, thereby reducing reliance on any data provider.

Specification

The PriceFeed Contract

Key Features:

  • Price Data Submission: Authorized nodes can submit price data to the contract.
  • Data Aggregation: Submitted prices are aggregated over a specified time interval (default 30 minutes).
  • Price Retrieval: Functions to retrieve the latest individual price or the aggregated price over a period.
  • Access Control: Only authorized nodes can submit price data managed by the contract owner.

Technical Details

  • Blockchain Compatibility: Core Blockchain (Ylem Version >=0.8.0)
  • Core Functions:
    • addPrice(uint _price): Allows authorized nodes to submit price data.
    • getLatestPrice(): Retrieves the latest submitted price.
    • getAggregatedPrice(): Retrieves aggregated price data.
  • Events:
    • PriceUpdated(uint timestamp, uint price): Emitted when a new price is submitted.

Rationale

The decentralized nature of the PriceFeed contract ensures that price data is not reliant on a single source, enhancing its reliability and security. Aggregating data over time also helps smooth out price volatility and provides a more stable reference for other contracts.

Backward Compatibility

This contract does not directly interact with the CBC20 token standard or other existing standards; hence, it maintains compatibility with existing Core Blockchain contracts.

Security Considerations

Key security considerations include ensuring the integrity and authenticity of the price data. Measures should be taken to vet and authorize only trustworthy nodes, and regular audits are recommended to check for potential vulnerabilities or manipulations.

Conclusion

The PriceFeed contract provides a crucial service for the Core Blockchain ecosystem by supplying reliable asset price data in a decentralized manner. Its integration is vital for the smooth functioning of many DeFi applications that rely on accurate price information.

Copyright and related rights waived via CC0.