MarketCap of a Token

Let’s say if you want the Marketcap of a Binance Smart Chain token (BSC token) or Etheruem token or any other chain token.

Here are the steps

1- Get total Supply
2- Getting Latest Price

Getting the Total supply of a token

To get the total supply, you can use our Address APIs to get the smart contract attributes. For example check the following query

{
  ethereum {
    address(address: {is: "0x514910771af9ca656af840dff83e8264ecf986ca"}) {
      annotation
      address
      smartContract {
        contractType
        attributes{
          name
          value
        }
        currency {
          symbol
          name
          decimals
          tokenType
        }
      }
      balance
    }
  }
}

To get the latest price, try following example query