Skip to content

Token Overview

This guide explains how to retrieve token data for M0 protocol tokens. The API provides metadata, holders, and supply information for multiple tokens including:

  • $M
  • POWER
  • ZERO

Query Multiple Tokens

Use the tokens query to retrieve metadata, supply data, and holder information for all tokens:

query TokensOverview {
  tokens {
    id
    name
    symbol
    decimals
    totalSupplys(first: 2, orderBy: blockTimestamp, orderDirection: desc) {
      value
      blockTimestamp
    }
    holders(first: 10, orderBy: balance, orderDirection: desc) {
      address
      balance
    }
  }
}

This query returns:

  • Token metadata (name, symbol, decimals, contract address)
  • Historical total supply snapshots
  • Top token holders and their balances

Use the token query to retrieve data for a specific token:

query TokenOverview($id: String!) {
  token(id: $id) {
    id
    name
    symbol
    decimals
  }
}

Important: Indexer Data Lag

The supply data returned by the indexer represents the last-seen state and may not reflect the absolute latest on-chain data. There can be a delay between when a transaction occurs on-chain and when the indexer processes it.

Querying Supply Directly from Chain

For the most up-to-date supply data, query the blockchain directly via RPC:

// Using viem, ethers.js or web3.js
const totalSupply = await tokenContract.totalSupply()

Note that the method to retrieve the total supply may vary between contracts. Before querying the blockchain directly, review the contract's ABI and documentation to ensure you're using the correct method.

You can find our token contracts on $M Deployments.