getTokenSupply - Solana

getTokenSupply. Provides the total supply of a specified SPL token

getTokenSupply - solana [Value: 14CU]
Provides the total supply of a specified SPL token, aiding developers
Use cases

Use cases

  • Fetch the complete supply details in the Solana network
  • Track variations in token supply to aid in market analysis
  • Examine token supply metrics to inform financial strategies
Constraints

Constraints

  • Requires valid Solana account public key
  • Network latency can affect response time
  • Program-specific data structures may vary significantly
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl https://solana.drpc.org \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0", "id":1, "method":"getTokenSupply", "params": ["7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"]}'
Copy
Response
200
{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "slot": 98123569
    },
    "value": {
      "amount": "5000000000",
      "decimals": 6,
      "uiAmount": 5000.0,
      "uiAmountString": "5000.0"
    }
  },
  "id": 1
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersarray
array
accountPublicKeystring
The public key of the account to query.
commitmentstring
The level of commitment required for the query
  • finalized - The node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized
  • confirmed - The node will query the most recent block that has been voted on by supermajority of the cluster
  • processed - The node will query its most recent block. Note that the block may not be complete

Response

200
Returns the total supply of a specific token, including details such as the raw supply count and the supply formatted with the token's decimal places

Response params

object
idinteger
jsonrpcstring
resultstring
object
contextobject
Contains information about the current state of the program
object
slotinteger
The slot number used to retrieve the fee calculator.
apiVersionstring
The version of the Solana RPC API being used
valueobject
object
addessstring
amountstring
Raw token supply, without decimals, as a u64 integer.
decimalsinteger
Number of decimal places the token uses.
uiAmountstring
Total token supply with mint-prescribed decimals (DEPRECATED).
uiAmountStringstring
Total token supply as a string, with mint-prescribed decimals.