# How to get supply of a token

**URL:** <https://community.bitquery.io/t/how-to-get-supply-of-a-token/1113>\
**Category:** GraphQL Tutorials\
**Created:** [July 6, 2022, 12:33pm UTC](https://community.bitquery.io/t/how-to-get-supply-of-a-token/1113 "2022-07-06T12:33:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://community.bitquery.io/u/gaurav)\
**Post date:** [July 6, 2022, 12:33pm UTC](https://community.bitquery.io/t/how-to-get-supply-of-a-token/1113/1 "2022-07-06T12:33:58Z")

</div>

You can get the supply of a token by checking the attributes of the smart contract

Here is an example to get smart contracts

> **[get attributed of a token](https://graphql.bitquery.io/ide/get-attributed-of-a-token)**
>
> get attributed of a token

**Check Burn tokens / Check Mint tokens**

To check burn tokens you need to check token transfers from the token contract to the burn address (there can be more than 1 burn address).

For mint you do the opposite, check the token transfer from the burn address to the token contract address.

> **[mint and burn supply of token](https://graphql.bitquery.io/ide/mint-and-burn-supply-of-token)**
>
> mint and burn supply of token

---

<div class="post-metadata">

**Author:** ![Raziel90](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@Raziel90](https://community.bitquery.io/u/Raziel90)\
**Post date:** [July 6, 2022, 8:01pm UTC](https://community.bitquery.io/t/how-to-get-supply-of-a-token/1113/2 "2022-07-06T20:01:27Z")

</div>

good evening, I tried the query and it also works with multiples of smart contracts, but the naming needs to be fixed, because the object containing the total is not always in the same position.

try this example:

```auto
query ($network: EthereumNetwork!) {
  ethereum(network: $network) {
    address(address: {in: ["0x050d94685c6b0477e1fc555888af6e2bb8dfbda5","0x761D38e5ddf6ccf6Cf7c55759d5210750B5D60F3"]}) {
      annotation
      address
      smartContract {
        attributes{
value

        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![sayon-bitquery](https://sea2.discourse-cdn.com/flex016/user_avatar/community.bitquery.io/sayon-bitquery/32/522_2.png) [@sayon-bitquery](https://community.bitquery.io/u/sayon-bitquery)\
**Post date:** [July 7, 2022, 6:19am UTC](https://community.bitquery.io/t/how-to-get-supply-of-a-token/1113/3 "2022-07-07T06:19:30Z")

</div>

Can you please explain a bit further on “not being in the same position” ??

---

<div class="post-metadata">

**Author:** ![sayon-bitquery](https://sea2.discourse-cdn.com/flex016/user_avatar/community.bitquery.io/sayon-bitquery/32/522_2.png) [@sayon-bitquery](https://community.bitquery.io/u/sayon-bitquery)\
**Post date:** [July 7, 2022, 6:31am UTC](https://community.bitquery.io/t/how-to-get-supply-of-a-token/1113/4 "2022-07-07T06:31:10Z")

</div>

Are you referring to the position of the **totalSupply** attribute not being in the same position in the response

The response to the above GraphQL query is as follows. Are you talking about **totalSupply** attribute not being in the same position for **0x761D38e5ddf6ccf6Cf7c55759d5210750B5D60F3** as it was for **0x050d94685c6b0477e1fc555888af6e2bb8dfbda5**??

```auto
{
  "ethereum": {
    "address": [
      {
        "annotation": "",
        "address": "0x050d94685c6b0477e1fc555888af6e2bb8dfbda5",
        "smartContract": {
          "attributes": [
            {
              "name": "name",
              "value": "Inu."
            },
            {
              "name": "totalSupply",
              "value": "1000000000000000000000000000000000"
            },
            {
              "name": "decimals",
              "value": "18"
            },
            {
              "name": "symbol",
              "value": "INU"
            }
          ]
        }
      },
      {
        "annotation": "",
        "address": "0x761d38e5ddf6ccf6cf7c55759d5210750b5d60f3",
        "smartContract": {
          "attributes": [
            {
              "name": "decimals",
              "value": "18"
            },
            {
              "name": "name",
              "value": "Dogelon"
            },
            {
              "name": "symbol",
              "value": "ELON"
            },
            {
              "name": "totalSupply",
              "value": "1000000000000000000000000000000000"
            }
          ]
        }
      }
    ]
  }
}

```

If yes, then in that case you can make use of “ **named indexing** ”, that way you won’t face indexing issues while dealing with GraphQL response.

---

<div class="post-metadata">

**Author:** ![Raziel90](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@Raziel90](https://community.bitquery.io/u/Raziel90)\
**Post date:** [July 7, 2022, 5:14pm UTC](https://community.bitquery.io/t/how-to-get-supply-of-a-token/1113/5 "2022-07-07T17:14:33Z")

</div>

I meant that, it was a little hard to just copy that element as api. thanks for the reply
