-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: update total STX supply to the year 2050 projected amount #1531
Conversation
…d in the Stacks 2.0 whitepaper
// See the Stacks 2.0 whitepaper: https://cloudflare-ipfs.com/ipfs/QmaGgiVHymeDjAc3aF1AwyhiFFwN97pme5m536cHT4FsAW | ||
// > The Stacks cryptocurrency has a predefined future supply that reaches approx 1,818M STX by year 2050 | ||
// > Block reward: 1000 STX/block for first 4 yrs; | ||
// > 500 STX/block for following 4 yrs; | ||
// > 250 for the 4 yrs after that; and then 125 STX/block in perpetuity after that. |
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.
@kantai does the Stacks implementation match this whitepaper description?
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.
Yes, though it uses bitcoin block height as opposed to calendar years:
See:
let effective_ht = burn_block_height.saturating_sub(first_burn_block_height);
let blocks_per_year = 52596;
let stx_reward = if effective_ht < blocks_per_year * 4 {
1000
} else if effective_ht < blocks_per_year * 8 {
500
} else if effective_ht < blocks_per_year * 12 {
250
} else {
125
};
from
first_burn_block_height
is 666050
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #1531 +/- ##
==========================================
+ Coverage 77.87% 77.97% +0.09%
==========================================
Files 105 105
Lines 10443 10443
Branches 2245 2245
==========================================
+ Hits 8133 8143 +10
+ Misses 2201 2192 -9
+ Partials 109 108 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
// We are going to use the year 2050 projected supply because "125 STX/block in perpetuity" means the total supply is infinite. | ||
export const TOTAL_STACKS = new BigNumber(1_818_000_000n.toString()); |
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.
@diwakergupta thoughts on using this value?
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.
Yeah anchoring on 2050 supply makes sense. I would also update the docs for this endpoint to include this qualified in big bold letters.
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.
Docs updated 👍
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.
LGTM
## [6.3.3](v6.3.2...v6.3.3) (2023-01-27) ### Bug Fixes * update total STX supply to the year 2050 projected amount ([#1531](#1531)) ([0689f60](0689f60))
🎉 This PR is included in version 6.3.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [7.0.0-beta.4](v7.0.0-beta.3...v7.0.0-beta.4) (2023-02-03) ### Features * add `smartContractUpdate` and `smartContractLogUpdate` to `PgWriteStore` event emitter ([#1462](#1462)) ([bce0ef9](bce0ef9)) ### Bug Fixes * add block_height index to contract_logs ([#1534](#1534)) ([dc53af2](dc53af2)) * add contract_identifier index on contract_logs table ([#1523](#1523)) ([1f16513](1f16513)) * avoid selecting `raw_tx` column on read queries ([#1453](#1453)) ([5acfc96](5acfc96)) * build rosetta with node 16 ([654b64f](654b64f)) * datastore tests ([bb96507](bb96507)) * is_unanchored property on /extended/v1/tx/:tx_id ([#1487](#1487)) ([4b85058](4b85058)) * lint docs ci dependencies ([#1458](#1458)) ([19c3a0d](19c3a0d)) * stop resolving revoked BNS names ([#1519](#1519)) ([095c4fc](095c4fc)) * test tx types ([11b9013](11b9013)) * update total STX supply to the year 2050 projected amount ([#1531](#1531)) ([0689f60](0689f60))
🎉 This PR is included in version 7.0.0-beta.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes hirosystems/explorer#973
The liquid stx amount that is calculated from the postgres db is accurate (or at least it matches the
total_liquid_supply_ustx
value reported by the stacks-node):/extended/v1/stx_supply - unlocked_stx: 1357774888442244
matches:/v2/pox - total_liquid_supply_ustx: 1357774888442244
However, the
total_stx
value is incorrect, and is currently greater than the liquid stx supply.The
total_stx
value is a constant that was copied from the Stacks 1.0 codebase, see #466stacks-blockchain-api/src/helpers.ts
Lines 220 to 222 in b6018dc
Here's what the Stacks 2.0 whitepaper states about about the STX supply:
This PR changes the
total_stx
value to the year 2050 projected STX amount, because "125 STX/block in perpetuity" means the total supply is not a constant.