You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/blockchain/Ethereum/transfers/total-supply.mdx
+48-11Lines changed: 48 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,49 @@ sidebar_position: 2
4
4
5
5
# Get Supply and Marketcap of a Token
6
6
7
-
## Get Supply of a Token
7
+
We will use the [Transaction Balance Tracker APIs](https://docs.bitquery.io/docs/blockchain/Ethereum/balances/transaction-balance-tracker/) for this query.
8
8
9
-
Let's see how to get the supply of a Token. We are taking TONCOIN token example in the following query. The token address for TONCOIN token is [0x582d872A1B094FC48F5DE31D3B73F2D9bE47def1](https://etherscan.io/token/0x582d872a1b094fc48f5de31d3b73f2d9be47def1)
10
-
You can check out the query [here](https://ide.bitquery.io/Total-supply-of-a-token-on-ethereum-mainnet_1).
SmartContract: { is: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" }
21
+
Fungible: true
22
+
}
23
+
}
24
+
}
25
+
) {
26
+
Block {
27
+
Time
28
+
Number
29
+
}
30
+
TokenBalance {
31
+
Currency {
32
+
Symbol
33
+
Name
34
+
SmartContract
35
+
Decimals
36
+
}
37
+
TotalSupply
38
+
Marketcap: TotalSupplyInUSD
39
+
}
40
+
}
41
+
}
42
+
}
43
+
```
44
+
45
+
## Alternative Method Using Transfer Cube
46
+
47
+
### Get Supply of a Token
48
+
49
+
```
15
50
query MyQuery {
16
51
EVM(network: eth, dataset: combined) {
17
52
Transfers(
@@ -45,11 +80,7 @@ query MyQuery {
45
80
}
46
81
```
47
82
48
-
## Get Marketcap of a token
49
-
50
-
Below query can be used to calculate Marketcap of a Token, first the query gets supply in the `amount` field then query uses join to get the `PriceInUSD`. Multiplying both of these will give you marketcap of the token.
51
-
In this example, we are calculating marketcap of Pepes Dog (ZEUS) token which has smart contract address `0x0f7dC5D02CC1E1f5Ee47854d534D332A1081cCC8`.
52
-
Try the query [here](https://ide.bitquery.io/supply-and-latest-price-of-token-to-get-marketcap).
83
+
### Getting Marketcap
53
84
54
85
```
55
86
{
@@ -78,6 +109,12 @@ Try the query [here](https://ide.bitquery.io/supply-and-latest-price-of-token-to
78
109
}
79
110
```
80
111
81
-
## Video Tutorial | How to get Supply and Market Cap of a Token
112
+
First the query gets supply in the `amount` field then query uses join to get the `PriceInUSD`. Multiplying both of these will give you marketcap of the token.
113
+
In this example, we are calculating marketcap of Pepes Dog (ZEUS) token which has smart contract address `0x0f7dC5D02CC1E1f5Ee47854d534D332A1081cCC8`.
114
+
Try the query [here](https://ide.bitquery.io/supply-and-latest-price-of-token-to-get-marketcap).
0 commit comments