Modular Design of RedStone

What is data aggregation?

Data aggregation involves collecting information (often from different sources) to create aggregated information that can be used for statistical analysis. A simple example of data aggregation is calculating the amount of sales in a specific product category for each region of your business. This approach simplifies the analysis of large volumes of data. Common types of aggregation include sum, average, maximum, minimum, and count.

Aggregation is a broad concept that can apply to many areas. For example, business, economics, computer science, statistics and others.

The important idea is this: combining multiple pieces of data into a coherent whole that sums things up helps form concrete conclusions. This makes it easier to work with the data depending on the area in which it will be used in the future.

Objects in computer science

In computer science, objects are products that exist in our world but have been converted into a form that can be used in a program. We can combine these objects to create new ones by writing so-called “properties” and combining “properties” that are similar to each other.

Despite the many uses, the main purpose remains almost the same. While different use cases may not always achieve the same goal, they may have a different purpose when combined together.

What happens if we mishandle the data before storing it on the blockchain? In this case, there is a risk of errors or deviations in the correctness of the data. This is where decentralized oracles or multiple oracles can come in and can solve or at least reduce this problem.

How does RedStone process data?

Based on the previous part, we noted that RedStone has an extensive data source from various DEXs and aggregators.

RedStone uses several methods to aggregate data called median, TWAP (time-weighted average price) and LWAP (liquidity-weighted average price).

The Importance of Data Aggregation at Home

The blockchain must be virtually certain that the data will be clean and usable. This can quickly become a problem if the data is not processed correctly or if any part of the network responsible for processing it fails: data integrity cannot be ensured.

Also, as I mentioned earlier, air conditioners are isolated from data outside their network. I need to completely trust external services, so choosing the right one that handles the data correctly is critical. I call such solutions oracles, which allow us to extract information from external sources and ensure its correct processing.

Using multiple oracles can be a problem if they do not work consistently. This increases the risk of data corruption, so the modular structure allows information to be obtained from multiple sources and layers, with the main focus on the program, which in this situation is represented by RedStone.

For each blockchain, it is important to determine whether to use multiple oracles or settle on one, such as RedStone, which offers a modular approach to decentralization. Moreover, there is virtually no risk of its failure. Why is this so? Repeaters and data come from multiple sources, which means that even if some of them fail, there will be no significant impact: the availability of information will be ensured because all sources operate independently of each other.

Median method in price analysis

There is another method that is based on calculating the median. This approach is significantly superior to the average and appears to be more resistant to manipulation by untrustworthy sources. However, even this technique cannot be called an ideal way to determine cost. Consider the following: you take the same ETH/USD value from a large cryptocurrency exchange (with $100 million in daily trading volume in the ETH/USD market) and four small exchanges (with about $10K in trading volume in the same ETH/USD market). USD). If a large exchange sets a price of $2,000, and all the smaller exchanges offer a price below $1,900, then the aggregate median price in this case will be less than $1,900. However, as you can imagine, it will still be quite far from the “real” market price.