-
Notifications
You must be signed in to change notification settings - Fork 15
Add supply information endpoint to status monitor #81
Conversation
Codecov Report
@@ Coverage Diff @@
## master #81 +/- ##
==========================================
+ Coverage 47.28% 51.16% +3.88%
==========================================
Files 10 11 +1
Lines 977 1069 +92
==========================================
+ Hits 462 547 +85
- Misses 515 522 +7
Continue to review full report at Codecov.
|
Co-authored-by: MacLane S Wilkison <maclane@nucypher.com>
General cleanup..
@mswilkison, current output: {
"current_total_supply": "1008524647.83 NU",
"est_circulating_supply": "389000000 NU",
"internal_allocations": {
"company": "200000000 NU",
"saft": "399000000 NU",
"team": "106000000 NU",
"worklock": "225000000 NU"
},
"max_supply": "3885390081.75 NU",
"staking_rewards_supply": "2876865433.91 NU"
} |
T> @mswilkison, current output:
Looks good - since we're nesting |
Actually thinking some more, maybe a buildup like the below makes the most sense?
|
@mswilkison that was a formatting error, we aren't nesting internal allocations in {
"current_total_supply": "1008524647.83 NU",
"est_circulating_supply": "389000000 NU",
"internal_allocations": {
"company": "200000000 NU",
"saft": "399000000 NU",
"team": "106000000 NU",
"worklock": "225000000 NU"
},
"max_supply": "3885390081.75 NU",
"staking_rewards_supply": "2876865433.91 NU"
}
For the build-up, what do you think about something like the following, assuming I can get the ordering to be maintained:
wdyt? |
Side note - what do we count issued rewards as...? Those can be unlocked if not restaked |
Looking pretty good. Just for consistency, ease of reading maybe /s/unlocked/"unlocked_allocations" and have it be a dict with both "saft1" and "casi" broken out separately
Maybe we just include them |
Actually I'm not sure about this, almost all of them are being restaked... maybe for now we leave out of circulating? |
What was the final number for CASI? Saft1 and CASI alone don't account for the rest of unlocked allocations eg. university staking - so should we add a catch-all entry like "other":
|
Definitely easiest to omit right now - not a simple calculation 😅 |
Right, forgot about uni! Those are actually locked (19,500,000 NU), so should go in locked_allocations. |
Include University Stakers in locked allocations. Added unit tests.
Current iteration: {
"initial_supply": {
"total_allocated": "1000000000 NU",
"locked_allocations": {
"saft2": "80000000 NU",
"team": "106000000 NU",
"company": "200000000 NU",
"worklock": "225000000 NU",
"university": "19500000 NU"
},
"unlocked_allocations": {
"saft1": "319000000 NU",
"casi": "8280000 NU",
"other": "42220000 NU"
}
},
"staking_rewards_supply": {
"total_allocated": "2885390081.75 NU",
"staking_rewards_issued": "9544346.16 NU",
"staking_rewards_remaining": "2875845735.59 NU"
},
"max_supply": "3885390081.75 NU",
"est_circulating_supply": "369500000 NU"
} Questions/notes:
|
Yes.
Let's do 9,000,000M NU which is the amount we've distributed so far for CASI.
Maybe call that
Makes sense. |
Latest output: {
"initial_supply":{
"total_allocated":"1000000000 NU",
"locked_allocations":{
"saft2":"80000000 NU",
"team":"106000000 NU",
"company":"200000000 NU",
"worklock":"225000000 NU",
"university":"19500000 NU"
},
"unlocked_allocations":{
"saft1":"319000000 NU",
"casi":"9000000 NU",
"ecosystem":"41500000 NU"
}
},
"staking_rewards_supply":{
"total_allocated":"2885390081.75 NU",
"staking_rewards_issued":"10383119.52 NU",
"staking_rewards_remaining":"2875006962.23 NU"
},
"max_supply":"3885390081.75 NU",
"est_circulating_supply":"369500000 NU"
} |
monitor/supply.py
Outdated
vest_24_month_factor = vesting_remaining_factor(vesting_months=24, cliff=False, now=now) | ||
vest_worklock_factor = vesting_remaining_factor(vesting_months=WORKLOCK_VESTING_MONTHS, cliff=True, now=now) | ||
vest_nuco_factor = vesting_remaining_factor(vesting_months=NUCO_VESTING_MONTHS, cliff=True, now=now) | ||
vest_university_factor = vesting_remaining_factor(vesting_months=UNIVERSITY_VESTING_MONTHS, cliff=True, now=now) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mswilkison pay particular attention here for vesting calcs, and how they are used.
…iles for determination of locked periods.
Current output with vested NU separated in unlocked allocations. {
"initial_supply":{
"total_allocated":"1000000000 NU",
"locked_allocations":{
"saft2":"80000000 NU",
"team":"106000000 NU",
"company":"200000000 NU",
"worklock":"225000000 NU",
"university":"19500000 NU"
},
"unlocked_allocations":{
"saft1":"319000000 NU",
"casi":"9000000 NU",
"vested":"0 NU",
"ecosystem":"41500000 NU"
}
},
"staking_rewards_supply":{
"total_allocated":"2885390081.75 NU",
"staking_rewards_issued":"10383138.7 NU",
"staking_rewards_remaining":"2875006943.05 NU"
},
"max_supply":"3885390081.75 NU",
"est_circulating_supply":"369500000 NU"
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very useful, nice work! 💹
# Staking Rewards Information | ||
staking_rewards_info = OrderedDict() | ||
supply_info['staking_rewards_supply'] = staking_rewards_info | ||
initial_supply_with_rewards = economics.initial_supply # economics.initial_supply includes issued rewards |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initial_supply_with_rewards = economics.initial_supply # economics.initial_supply includes issued rewards | |
initial_supply_with_rewards = economics.token_supply_at_period # economics.initial_supply includes issued rewards |
Is this used to return the supply in this current moment (i.e. right now would be the initial 1bn + ~12m rewards issued since launch). If so the BaseEconomics
class doesn't actually provide an expression for the supply in a given moment, but StandardTokenEconomics
does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was working off of @KPrasch's point - https://discord.com/channels/411401661714792449/412681039178366996/770397121831501854 - that initial supply already includes rewards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arjunhassard thanks for raising this - just realized that I should not create an Economics class in the constructor, and reuse it - rather, I should obtain a fresh copy of the Economics every time the endpoint is invoked.
re: StandardTokenEconomics - I'm not sure I have direct access to that class.
Fixes #80 .