Distribution - How it works

In the distribution we get all the values from the oracles and reset the working capital to the amount that has been repaid and try to recover any potential capital that might have been lost by taking the Oracles Standby Capital.
The Standby Capital will be sent back to the Oracle that deposited it if there was no capital lost.

We later calculate the "alpha" value, which determines if the distributeSlashInflation() will be called

The alpha value is the percentage of totalCapitalRecovered / totalOriginalCapital

If the value is 0 we'll have no distribution and no inflation. If the value is 100 only inflation takes place as every oracle recovered money and potentially made money.

Then we calculate the winning oracles and the winning oracle votes which will be used in further calculations like the slashing/rewarding and the inflation distribution as the rewards and the inflation only goes to the winners.

After the Pool gets the cost of capital, the excess capital an oracle might have achieved (aka the spread) is split between the stakers and the oracles.

The slashing/rewards, as well as the inflation, are set as rates that are used to calculate the stake of each user as well as the LP rewards in the Pool.

Those updates of the stake and the rewards are virtual and can be accessed with:

  • getVirtualCurrentStakeBalance: this function returns your actual staking balance, calculated on the fly according to your actions and rewards.
  • getExcessCapitalToClaim: this function returns the total capital that you were rewarded and you can claim.