WhitePaper

OVERVIEW

FlowPrices Oracle is an Oracle deployed in the Flow BlockChain, it provides decentralized real-time crypto price data setted by a group of validators that interacts with a new concept called dataBlock #architecture, where the real-time price is calculated based on all the prices provided by the validators in the last seconds.

MOTIVATION & WHAT WE SOLVE

Almost every web3 developer have faced the challenge of try to get the crypto price of any asset in a contract for a marketplace,web3 game,... on-chain without the use of a web2 solution. We provide an on-chain rel-time oracle for that that updates the crypto price of an asset every 10 seconds, like this every developer on the blockchain can integrate this executing a simple function to the oracle for get the price.

The Decentralized OnChain Real-time Crypto Prices Oracle solves the problem of trust and reliability in obtaining up-to-date cryptocurrency prices for smart contracts. By leveraging validators distributed across the network, it ensures that the price data is accurate, tamper-proof, and verifiable. This solution enables seamless integration of real-time market data into smart contracts, facilitating decentralized financial applications, such as automated trading, lending, and derivatives, with increased transparency and security.

HOW ARE WE UNIQUE?

We are providing a unique functionality that its new and unique to the Flow Blockchain.

We are also unique not only providing a real-time crypto price data, else we are unique of the infrastucture that makes this real, thanks to the validators who provides trusted data.

ARCHITECTURE (DataBlocks & Validators)

The architecture has been carefully designed with scalability in mind, catering to both validators and users seeking real-time data. One of the key innovations in this design is the introduction of a new concept called dataBlocks. These dataBlocks serve as crucial resources stored on the smart contract, specifically tailored to accommodate the needs of validators and the data requirements of users.

Let's start by understanding the role of validators within this architecture. Validators are trusted software entities or organizations responsible for retrieving the most recent price data from reliable sources. They play a pivotal role in updating the dataBlocks associated with each cryptocurrency. When a validator receives the latest price for a particular asset, it adds this information to the relevant dataBlock.

A dataBlock, as mentioned earlier, is a resource stored on the smart contract. It contains an array of prices, each value representing a recent price entry along with its associated timestamp and the validator who added it. The dataBlock also incorporates a sophisticated algorithm responsible for calculating the cryptocurrency's current price based on the stored data.

Now, let's delve into the process of updating the price, using the example of FlowToken:

  1. Validator updates the price: When a validator receives a new price for FlowToken, it executes a function on the corresponding dataBlock of FlowToken within the smart contract. This function enables the dataBlock to capture and store the new price.

  2. Instant execution of the update price algorithm: Crucially, as soon as a new price is pushed to the dataBlock, the update price algorithm is instantly triggered. This algorithm performs two essential actions:

    a. Verification of price values: The algorithm scans the prices array within the dataBlock and removes any prices that have been present for more than 10 seconds. By doing this, it ensures that only the most recent prices, reflective of the latest market conditions, are retained within the dataBlock.

    b. Calculation and update of average prices: The algorithm then calculates the average price using the newest values from the prices array. This ensures that the calculated price is based on the most up-to-date data available within the dataBlock.

By employing this approach, the architecture can function effectively even with just one validator. However, the true strength lies in its ability to scale with multiple validators. With a larger number of validators working in tandem and updating the prices every few seconds, the system achieves a higher level of security and trust in the legitimacy of the prices being recorded.

In conclusion, this thoughtfully designed architecture, built around the concept of dataBlocks, offers scalability benefits for both validators and users. It optimizes the storage and processing of price data while ensuring that the most recent, trustworthy prices are available to users seeking real-time information.

Last updated