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

totalSupply Function Does Not Return Expected Results #139

Open
PaladinDotEth opened this issue Nov 2, 2023 · 6 comments
Open

totalSupply Function Does Not Return Expected Results #139

PaladinDotEth opened this issue Nov 2, 2023 · 6 comments

Comments

@PaladinDotEth
Copy link

I'm currently utilizing the version hosted at uniswap-v2-dev, but I'm consistently receiving incorrect values '15640' or '14448.' Are there alternative versions available for use?

@Data-Nexus
Copy link

I'll inspect this one further. I am noticing that the totalSupply is incorrect on a pool that I'm testing on the hosted service, however the decentralized network subgraph seems to give me a correct version.

https://thegraph.com/explorer/subgraphs/A3Np3RQbaBA6oKJgiwDJeo5T3zrYfGHPWFYayMwtNDum?v=1&view=Playground&chain=arbitrum-one

@Data-Nexus
Copy link

@PaladinDotEth with the resync, this should be resolved. Can you double check that you're now receiving the expected values?

@simple-marvin
Copy link

simple-marvin commented Feb 2, 2024

@Data-Nexus
when i use the above link and the below query, it also shows me weird numbers

query:
{
tokens(first: 5, orderBy:tradeVolumeUSD orderDirection:desc) {
id
symbol
name
decimals
totalSupply
}
}

result:
{
"data": {
"tokens": [
{
"id": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"symbol": "WETH",
"name": "Wrapped Ether",
"decimals": "18",
"totalSupply": "15640"
},
{
"id": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"symbol": "USDC",
"name": "USD//C",
"decimals": "6",
"totalSupply": "14864"
},
{
"id": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"symbol": "USDT",
"name": "Tether USD",
"decimals": "6",
"totalSupply": "14448"
},
{
"id": "0xa47c8bf37f92abed4a126bda807a7b7498661acd",
"symbol": "UST",
"name": "Wrapped UST Token",
"decimals": "18",
"totalSupply": "14448"
},
{
"id": "0xc8d674114bac90148d11d3c1d33c61835a0f9dcd",
"symbol": "mNFLX",
"name": "Wrapped Mirror NFLX Token",
"decimals": "18",
"totalSupply": "14448"
}
]
}

token with correct totalSupply from etherscan:
weth - 15640 - 3276063798496846980898561
usdc - 14864 - 23398309739224635
usdt - 14448 - 44005847706828943
ust - 14448 - 295788247260048794239793908
mNFLX- 14448 - 3083201876426681305152

@Data-Nexus
Copy link

Interesting, I assumed you were interested in the pool's total supply.

Honestly I wouldn't use the token.totalSupply since this is fetched at the time the token is first utilized in the subgraph, and does not change over time. So for WETH, it would fetch the total supply at the time the first WETH pool was created, as more ETH gets wrapped this will not change the token's totalSupply.

If the token was minted with a hard cap, it'd probably be fine.

@simple-marvin
Copy link

simple-marvin commented Feb 5, 2024

I am interested in the tokens total supply, i get the Liquidity through "totalLiquidity".

I need the total supply for each Token i fetch for my Project, so it would be really nice if one could fix it.

Edit: V3 shows the right totalSupply

https://thegraph.com/explorer/subgraphs/HUZDsRpEVP2AvzDCyzDHtdc64dyDxx8FQjzsmqSg4H3B?view=Playground&chain=arbitrum-one

@sean00880
Copy link

Exactly what I just noticed. TokenSupply is all wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants