Skip to main content

Solana Token Supply API

In this section we will see how to get Solana Token Supply information using our API.

This Solana API is part of our Early Access Program (EAP), which is intended for evaluation purposes. This program allows you to test the data and its integration into your applications before full-scale implementation. Read more here.

Subscribe to Token Supply Changes

This subscription will return the token supply changes in realtime. PostBalance will give you the current supply. Check the query here

subscription {
Solana{
TokenSupplyUpdates {
TokenSupplyUpdate {

Amount
Currency {
MintAddress
Name
}

PreBalance
PostBalance
}
}
}
}

Get Supply of specific Token

This query will return the latest token supply of a specific token. We are getting here supply for this 6D7NaB2xsLd7cauWu1wKk6KBsJohJmP2qZH9GEfVi5Ui token PostBalance will give you the current supply for this token. Check the query here

{
Solana {
TokenSupplyUpdates(
limit:{count:1}
orderBy:{descending:Block_Time}
where: {TokenSupplyUpdate: {Currency: {MintAddress: {is: "6D7NaB2xsLd7cauWu1wKk6KBsJohJmP2qZH9GEfVi5Ui"}}}}
) {
TokenSupplyUpdate {
Amount
Currency {
MintAddress
Name
}
PreBalance
PostBalance
}
}
}
}

Get newly created Pump Fun tokens and their Metadata

Now you can track the newly created Pump Fun Tokens along with their dev address, metadata and supply. PostBalance will give you the current supply for the token. Check the query here

subscription {
Solana {
TokenSupplyUpdates(
where: {Instruction: {Program: {Address: {is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"}, Method: {is: "create"}}}}
) {
Block{
Time
}
Transaction{
Signer
}
TokenSupplyUpdate {
Amount
Currency {
Symbol
ProgramAddress
PrimarySaleHappened
Native
Name
MintAddress
MetadataAddress
Key
IsMutable
Fungible
EditionNonce
Decimals
Wrapped
VerifiedCollection
Uri
UpdateAuthority
TokenStandard
}
PostBalance
}
}
}
}

Get newly created Moonshot tokens and their Metadata

Now you can track the newly created Moonshot Tokens along with their metadata and supply. PostBalance will give you the current supply for the token. Check the query here

subscription {
Solana {
TokenSupplyUpdates(
where: {Instruction: {Program: {Address: {is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG"}, Method: {is: "tokenMint"}}}}
) {
TokenSupplyUpdate {
Amount
Currency {
Symbol
ProgramAddress
PrimarySaleHappened
Native
Name
MintAddress
MetadataAddress
Key
IsMutable
Fungible
EditionNonce
Decimals
Wrapped
VerifiedCollection
Uri
UpdateAuthority
TokenStandard
}
PostBalance
}
}
}
}

Marketcap of a Token

We use PostBalanceInUSD field to get the marketcap. Since it is built on real-time data, you will get the Marketcap if the token was active in the past 8 hours or is being transacted in real-time. This query returns latest marketcap of a particular token.

query MyQuery {
Solana {
TokenSupplyUpdates(
where: {
TokenSupplyUpdate: {
Currency: {
MintAddress: { is: "6D7NaB2xsLd7cauWu1wKk6KBsJohJmP2qZH9GEfVi5Ui" }
}
}
}
limit: { count: 1 }
orderBy: { descending: Block_Time }
) {
TokenSupplyUpdate {
PostBalanceInUSD
}
}
}
}

Monitor Market Cap Metric for a Pump Fun Token

The subscription given below could be used to setup a websocket like solution that monitors market cap of a Pump Fun token in real time, where the PostBalanceInUSD is essentially the marketcap of the token.

subscription {
Solana {
TokenSupplyUpdates(
where: {
TokenSupplyUpdate: {
Currency: {
MintAddress: { is: "98mb39tPFKQJ4Bif8iVg9mYb9wsfPZgpgN1sxoVTpump" }
}
}
}
limitBy: { by: TokenSupplyUpdate_Currency_MintAddress, count: 1 }
) {
TokenSupplyUpdate {
PostBalanceInUSD
}
}
}
}

Top Solana Tokens By MarketCap

This query returns the top Solana tokens based on the latest MarketCap.

query MyQuery {
Solana {
TokenSupplyUpdates(
orderBy: {
descending: Block_Time
descendingByField: "TokenSupplyUpdate_Marketcap"
}
limitBy: { by: TokenSupplyUpdate_Currency_MintAddress, count: 1 }
) {
TokenSupplyUpdate {
Marketcap: PostBalanceInUSD
Currency {
Name
Symbol
MintAddress
Fungible
Decimals
}
}
}
}
}

Top 100 Pump Fun Tokens By MarketCap

This query returns the top Solana tokens based on the latest MarketCap.

query MyQuery {
Solana {
TokenSupplyUpdates(
where: {
TokenSupplyUpdate: { Currency: { MintAddress: { includes: "pump" } } }
}
orderBy: {
descending: Block_Time
descendingByField: "TokenSupplyUpdate_Marketcap"
}
limitBy: { by: TokenSupplyUpdate_Currency_MintAddress, count: 1 }
limit: { count: 100 }
) {
TokenSupplyUpdate {
Marketcap: PostBalanceInUSD
Currency {
Name
Symbol
MintAddress
Fungible
Decimals
Uri
}
}
}
}
}

Get Solana Tokens With a Specific MarketCap

Lets say we need to get the tokens whose marketcap has crossed the 1M USD mark but is less than 2M USD for various reasons like automated trading. We can get the token details that have crossed a particular marketcap using this query.

query MyQuery {
Solana {
TokenSupplyUpdates(
where: {
TokenSupplyUpdate: {
PostBalanceInUSD: { ge: "1000000", le: "2000000" }
}
}
orderBy: { descending: Block_Time }
limitBy: { by: TokenSupplyUpdate_Currency_MintAddress, count: 1 }
) {
TokenSupplyUpdate {
Marketcap: PostBalanceInUSD
Currency {
Name
Symbol
MintAddress
Decimals
Uri
}
}
}
}
}

Video Tutorial on Streaming and Getting Total Supply of a Solana Token

Video Tutorial on Getting New Pump Fun Token Metadata