EnormousCloud / api3-dao-tracker

API3 DAO Tracker
https://enormous.cloud/dao/api3/tracker/
MIT License
3 stars 1 forks source link

Absolute staking target is incorrect #2

Closed bbenligiray closed 3 years ago

bbenligiray commented 3 years ago

Here at the bottom right https://enormous.cloud/dao/api3/tracker/ It reads

Staking Target 50,000,000 tokens

which doesn't match what's on the DAO dashboard.

The stakeTarget at the pool is represented in percentages (where 10^18 is 100%), which refers to a percentage of the total supply of API3. This was done to avoid having to keep adjusting the stake target with inflation/deflation.

Here's a snippet that describes what should happen

HUNDRED_PERCENT = ethers.BigNumber.from(`1${"0".repeat(18)}`);
stakeTargetInTokens = api3Supply.mul(stakeTarget).div(HUNDRED_PERCENT).div(ethers.utils.parseEther("1")).toNumber();
EnormousCloud commented 3 years ago

great details, thanks, I will correct this