Data Feed Handling

Data Feeds and Data Sources

This chain supports low frequency as well as higher frequency data updates. It is not meant for billions of ticks per second, but should easily handle a few million ticks per second during market events.

The ideal data feed comes directly from the data source, such as exchanges or any other marketplace where the data is created (trade, weather station, …)

Data Feed Problems

There are a number of problems that can arise, which need to be addressed:

  1. What data provider gets rewarded?
  2. Is it stake based or is it quality based? What determines the “best quality”?
  3. When do data providers get slashed for bad data?
  4. Piggybacking on data feeds: How to find out if data is merely a delayed feed of someone else?
  5. Data Flooding: How to prevent a forced average by flooding a specific rate with data sources?
  6. Malicious validators: What if a validator maliciously
  7. Contract piggybacking relay: A Contract pays for the feed and relays the data to other contracts.

Data Provider Rewards and Slashing

In a first iteration we will provide commission based on the nearest stake-weighted average data provider with a linear decay. E.g. there are 5 data providers for EUR/USD rate. The weighted average for the price based on the stake is

Blog Image

That is an example of calculating the ground truth for the price and considered the “TruePrice”. Commission is paid based on the difference between the price given by the data provider and the weighted average price with a decay between them and a slashing function if the price diverges too far.

Blog Image

Ideally, the price difference, where rewards and slashing are coming into effect, are calculated dynamically based on the amount of data providers, asset volatility etc.

The “TruePrice” can also be dependent on the time decay since the data provider joined, the reliability of the price feed over time (how many times was the price close to the average price), or other metrics.

This is something that needs to be tested and addressed in a test environment.

Piggybacking on Data Feeds

Another problem is the piggybacking on data feeds. That is, someone is listening to incoming ticks and then providing the ticks with a slight delay back into the system.