Skip to content
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

feat: signers page #1467

Merged
merged 43 commits into from
May 16, 2024
Merged

feat: signers page #1467

merged 43 commits into from
May 16, 2024

Conversation

He1DAr
Copy link
Collaborator

@He1DAr He1DAr commented Feb 27, 2024

#1454
#1248

image

NB: The extra text at the bottom of the STX stacked card and the Addresses stacking card are not showing because I have coded it to not show if the token price for STX and BTC are undefined.

This PR changes the figure that we use for total supply on the homepage and signers page @saralab @andresgalante

Home page

Before:
image

After:
image
@eugeniadigon Does this look ok. I know you wanted to change this based on the thread in Slack but I wasn't sure what the final decision was on the design

Signers page
image

Up until this point, we have been using 1.82 B as the total supply of the STX token. However, accoridng to the whitepaper, 1.82B is the predefined future supply for 2050. Thus, I do not think that 1.82B accurately represents the total supply today. Total supply represents the amount of tokens that exist today, that have been minted or mined into existence, whether they are staked/locked/unlocked etc. The tokens exist in some form or fashion and can be accounted for on the blockchain.

// 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.
// 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());

Where we are using the hardcoded 1.82 B total supply today we should be using the circulating/liquid supply. Circulating supply is a subset of total supply. It is the amount of tokens that have been minted or mined, minus tokens that are locked and vesting, and that are available to trade. Circulating supply includes staked/stacked tokens, as they can be unstaked/unstacked and traded. As far as I know, there aren't any STX tokens that have not vested already and have not been put into circulation. If we had that data, those tokens + the circulating/liquid supply would give us an accurate figure for total supply.

The circulating supply we get from the liquid supply from pox (unlocked_stx), as well as the unlocked supply from stx_supply (total_liquid_supply_ustx)
Total supply from from stx_supply (total_stx) is hardcoded at 1.82B
% of STX stacked we calculate from pox as current_cycle.stacked_ustx / total_liquid_supply_ustx
% of STX not stacked is 1 - current_cycle.stacked_ustx / total_liquid_supply_ustx

Slack context on my discussion of this with @zone117x and @rafaelcr - https://hiropbc.slack.com/archives/C03TU42NL05/p1715273786154159?thread_ts=1715173202.705129&cid=C03TU42NL05

IMPORTANT: If we change the total supply to circulating supply on the explorer, it will conflict with what coinmarketcap shows. So if we go ahead with this change then we should get in touch with CMC to get it changed there as well
@saralab

image

Copy link

vercel bot commented Feb 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hiro-explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2024 4:21pm

Copy link

codecov bot commented Feb 27, 2024

Codecov Report

Attention: Patch coverage is 6.49573% with 547 lines in your changes are missing coverage. Please review.

Project coverage is 17.91%. Comparing base (d9fdb39) to head (2dffae5).
Report is 4 commits behind head on main.

Files Patch % Lines
src/app/signers/SignerDistributionPieChart.tsx 16.96% 137 Missing ⚠️
src/app/signers/SignersTable.tsx 0.00% 66 Missing ⚠️
src/app/signers/AddressesStackingCard.tsx 0.00% 45 Missing ⚠️
src/app/signers/CurrentCycle.tsx 0.00% 41 Missing and 1 partial ⚠️
src/app/signers/skeleton.tsx 0.00% 28 Missing ⚠️
src/app/signers/StxStackedCard.tsx 0.00% 27 Missing ⚠️
src/app/signers/SignerDistribution.tsx 0.00% 21 Missing ⚠️
src/app/signers/SignersHeader.tsx 0.00% 20 Missing ⚠️
src/app/signers/NextCycleCard.tsx 0.00% 19 Missing ⚠️
src/app/signers/SignerDistributionLegend.tsx 29.16% 17 Missing ⚠️
... and 17 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1467      +/-   ##
==========================================
- Coverage   18.59%   17.91%   -0.69%     
==========================================
  Files         443      464      +21     
  Lines        7523     8023     +500     
  Branches     1598     1719     +121     
==========================================
+ Hits         1399     1437      +38     
- Misses       5917     6378     +461     
- Partials      207      208       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@andresgalante
Copy link
Member

The UI looks great! The only thing I saw is that the table doesn't do horizontal scrolling on small viewports

@ginny-d
Copy link

ginny-d commented Feb 28, 2024

  • Arrow: Can it be green-600 / green-500 when up, and red-600 / red-500 when down?
Screenshot 2024-02-28 at 14 43 06

Progress bar:

  • Update the stroke width to 4px
  • On dark mode, it appears to have some white grains/pixels around, which makes it look low quality
Screenshot 2024-02-28 at 14 43 03
  • For the last row of signers, would it be possible to hide the line on the bottom, so it doesn't make this 'double line' effect?
Screenshot 2024-02-28 at 14 43 19
  • The Bitcoin icon should be before the block number, and the block number is missing a #
Screenshot 2024-02-28 at 14 43 24

@janniks
Copy link
Contributor

janniks commented Feb 29, 2024

Screenshot 2024-02-28 at 18 07 25
minor notes, might already be covered elsewhere or already todo:

  • Make space between a number+symbol non-breaking (to keep them on the same line)
  • Starts in ~10 needs "minutes" or something?
  • Maybe add info tooltips to explain what the difference between stacked/locked is here. Add "STX" prefix to "Locked"?
  • -54% -- not sure if this should be absolute (Math.abs)

@BLuEScioN BLuEScioN self-requested a review May 15, 2024 20:51
@saralab
Copy link
Contributor

saralab commented May 16, 2024

@andresgalante @BLuEScioN

Reviewed the threads etc, let's try to simplify this:
On the home screen, change it the Circulating Supply to
1.46B/1.82B
21.0% stacked (or whatever %ge is currently stacked)

Also, on the Signer screen , under the Total Stacked, change the / 1.46B circulating supply. to "of 1.46B circulating supply"

@BLuEScioN BLuEScioN merged commit 687a883 into main May 16, 2024
13 of 17 checks passed
@BLuEScioN BLuEScioN deleted the feat/signers-page branch May 16, 2024 19:16
blockstack-devops pushed a commit that referenced this pull request May 16, 2024
# [1.178.0](v1.177.1...v1.178.0) (2024-05-16)

### Features

* signers page ([#1467](#1467)) ([687a883](687a883))
@blockstack-devops
Copy link

🎉 This PR is included in version 1.178.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

7 participants