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

fix: fixed supply #s #1887

Merged
merged 1 commit into from
Oct 31, 2024
Merged

fix: fixed supply #s #1887

merged 1 commit into from
Oct 31, 2024

Conversation

BLuEScioN
Copy link
Collaborator

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Fixes supply stats on the homepage.
Slack context: https://hiropbc.slack.com/archives/C03TU42NL05/p1730334206249929?thread_ts=1730330803.165729&cid=C03TU42NL05

the explorer is dividing circulatingSupply = total_liquid_supply_ustx / MICROSTACKS_IN_STACKS = 1501825000.29185
by
totalSupplyNumber = unlocked_stx = 1498769444.73627
total_liquid_supply_ustx is taken from /v2/pox
unlocked_stx is taken from api.infoApi.getStxSupply({})
Interestingly, total_stx, taken from api.infoApi.getStxSupply({}), is 1498769444.73627, which is the same as unlocked_stx, as well as less than total_liquid_supply_ustx.
I can see that the response for api.infoApi.getStxSupply({}) has changed. It now includes total_stx_year_2050, which we weren't using before. I will fix that.
The main issue is that we are taking the circulating supply from total_liquid_supply_ustx from /v2/pox, which is returning a number that is higher than the total_stx and unlocked_stx returned from https://api.hiro.so/extended/v1/stx_supply.
It seems like we should use unlocked_stx as the circulating supply and total_stx as total stx. Both are the same so the % unlocked should be 100%.
The API should investigate why total_liquid_supply_ustx taken from /v2/pox is returning a higher #
@matt

@rafael

Issue ticket number and link

Checklist:

  • I have performed a self-review of my code.
  • I have tested the change on desktop and mobile.
  • I have added thorough tests where applicable.
  • I've added analytics and error logging where applicable.

Screenshots (if appropriate):

@BLuEScioN BLuEScioN requested a review from He1DAr October 31, 2024 00:26
Copy link

vercel bot commented Oct 31, 2024

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

Name Status Preview Comments Updated (UTC)
explorer-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 31, 2024 0:28am
hiro-explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 31, 2024 0:28am

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/app/_components/Stats/StxSupply/index.tsx 0.00% 4 Missing ⚠️
src/common/queries/useStxSupply.ts 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@BLuEScioN BLuEScioN merged commit 94d1343 into main Oct 31, 2024
14 of 17 checks passed
@BLuEScioN BLuEScioN deleted the fix/circulating-supply branch October 31, 2024 15:02
@blockstack-devops
Copy link

🎉 This PR is included in version 1.221.1 🎉

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.

3 participants