Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

BED Page and other Token Stats bugs #330

Closed
0xModene opened this issue Jul 30, 2021 · 7 comments · Fixed by #336
Closed

BED Page and other Token Stats bugs #330

0xModene opened this issue Jul 30, 2021 · 7 comments · Fixed by #336
Assignees
Labels
bug Something isn't working

Comments

@0xModene
Copy link
Contributor

0xModene commented Jul 30, 2021

Describe the bug
Coingecko is slow to roll out the MCAP for BED, and this seems to be a common pattern with them. Alongside this, there seems to be a bug caused by this that prevents the hiding of the supply cap stat, which should not show for simple indices

Expected behavior
The BED product page should show an MCAP differently than it currently does.
By default, the value should be '--'.
If MCAP is provided by CoinGecko, instead show it.
Else, a rough estimate of MCAP should be calculated, formatted, and show (currentSupply * CG Price). This also requires a user to connect their wallet. You might have to pass this value in and add it to ProductTokenStatsProps (this will cascade to a few changes on each product page)

For supply cap: @ src/components/ProductPage/ProductTokenStats.tsx:30
image
Move supplyCap ? to line 39 below, following the pattern on streamingFee (ln 32)
image

Screenshots
image

Additional context
Supply data is coming from the token contract, so it will require a provider.

@0xModene 0xModene added the bug Something isn't working label Jul 30, 2021
@0xModene 0xModene self-assigned this Jul 30, 2021
@tytarman
Copy link
Contributor

oh yay!
I'll dig in and see what I can do.
Thanks for the details in the post.

rootulp added a commit to rootulp/index-ui that referenced this issue Aug 9, 2021
@rootulp
Copy link
Contributor

rootulp commented Aug 9, 2021

Supply data is coming from the token contract, so it will require a provider.

Why do we want to fallback to the Coingecko currentSupply if we've already fetched the supply from the token contract and have that available in this component (via currentSupply)? Is the supply data that comes from the token contract not reliable?

rootulp added a commit to rootulp/index-ui that referenced this issue Aug 9, 2021
Fixes IndexCoop#330

If a market cap is provided, display it.
If total supply is provided, approximate market cap as supply * price.
If market cap and supply aren't provided, display "--"
@0xModene
Copy link
Contributor Author

0xModene commented Aug 9, 2021

Supply data is coming from the token contract, so it will require a provider.

Why do we want to fallback to the Coingecko currentSupply if we've already fetched the supply from the token contract and have that available in this component (via currentSupply)? Is the supply data that comes from the token contract not reliable?

The primary is the CG MCAP, not 'currentSupply'. The pricing on CG is generally reliable but the math required to calculate MCAP may not be as accurate as the actual MCAP, which is why it should be the fallback (currentSupply * CG Price).

This should eventually get overwritten with on-chain data that we don't currently have.

@rootulp
Copy link
Contributor

rootulp commented Aug 10, 2021

Right. I understand the best option is CoinGecko market cap. In the fallback scenario, are you proposing we use CoinGecko currentSupply or token contract currentSupply? #336 uses token contract currentSupply.

@0xModene
Copy link
Contributor Author

Right. I understand the best option is CoinGecko market cap. In the fallback scenario, are you proposing we use CoinGecko currentSupply or token contract currentSupply? #336 uses token contract currentSupply.

Token contract current supply, CoinGecko price

@rootulp
Copy link
Contributor

rootulp commented Aug 10, 2021

Token contract current supply, CoinGecko price

Thanks for clarifying and sorry for my confusion. I agree with that proposal. Sorry I split the fix for this into two separate PRs. Can we re-open until #336 or something similar is merged?

@0xModene
Copy link
Contributor Author

Sure thing

@0xModene 0xModene reopened this Aug 10, 2021
controtie pushed a commit that referenced this issue Aug 14, 2021
* Improve market cap

Fixes #330

If a market cap is provided, display it.
If total supply is provided, approximate market cap as supply * price.
If market cap and supply aren't provided, display "--"

* Remove console logs
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants