Total Supply Endpoints

Current

The total-supply endpoint,

/v1/tokens/<chain id>/<token address>/total-supply

returns the total number of tokens available on the blockchain.

total supply =  number of tokens minted - number of tokens burned

You will find the formal API definition here.

The Scaling section should be consulted to understand the optional scaled parameter.

Given the following call:

curl -X 'GET' \
-H 'Authorization: Bearer <API KEY>' \
'https://gateway.credmark.com/v1/tokens/1/0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9/total-supply'

The endpoint returns:

{
  "chainId":1,
  "blockNumber":17073192,
  "blockTimestamp":1681816295,
  "tokenAddress":"0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9",
  "scaled":true,
  "totalSupply":16000000
}

Historical

The total-supply/historical endpoint,

/v1/tokens/<chain id>/<token address>/total-supply/historical

returns a list of the total number of tokens available over time.

The list start and end, as well as periodicity arguments are described in the Historical Data section.

Given the following call, which requests total supply for three blocks:

curl \
-H 'Authorization: Bearer <API KEY>' \
'https://gateway.credmark.com/v1/tokens/1/0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9/total-supply/historical?scaled=true&startBlockNumber=14966197&endBlockNumber=14966200&blockInterval=1'

the endpoint returns:

{
  "chainId": 1,
  "startBlockNumber": 14966197,
  "endBlockNumber": 14966200,
  "startTimestamp": 1655276429,
  "endTimestamp": 1655276478,
  "tokenAddress": "0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9",
  "scaled": true,
  "data": [
    {
      "blockNumber": 14966197,
      "blockTimestamp": 1655276429,
      "totalSupply": 16000000
    },
    {
      "blockNumber": 14966198,
      "blockTimestamp": 1655276469,
      "totalSupply": 16000000
    },
    {
      "blockNumber": 14966199,
      "blockTimestamp": 1655276471,
      "totalSupply": 16000000
    },
    {
      "blockNumber": 14966200,
      "blockTimestamp": 1655276478,
      "totalSupply": 16000000
    }
  ]

This is hardly surprising since token supply rarely changes. This endpoint would typically be used to look at token supply across large periods of time.

Last updated