Oracle

Overview

The Oracle module is an election and price feed information module which stores prices from external data with asset IDs from the Token module as keys. Oracle providers are elected in every era with the amount staked from the users. Oracle providers produce price information and are rewarded in each era on each block reward. Prices are stored in the state, and oracle providers are reviewed in each era. If they produce outliers, they get slashed. The total reward for each oracle provider in each era is recorded by the Reward module and stakers can get their rewards by claiming them.

Reward

points are stacked in every rebase(10 blocks). When an era ends, the block reward is divided by half to reward network validators, and oracles. oracles get block reward proportionally to their stacked point in an era. oracle providers are replaced with new ones in oracle provider pool.

Slashing

  1. quicksort oracle data in reward distribution

  2. outlier is detected with x < p25 - 1.5 * (p75 - p25) or x > p75 + 1.5 * (p75 - p25)

  3. check if the outlier is within range of 1% error

  4. if it is, slash the oracle node by 1/3.

  5. reward rest of the node.