Skip to main content

Stablecoin Balance API

The Stablecoin API by Bitquery provides you the comprehensive set of APIs which can provide you realtime transfers, realtime trades, realtime price, holder distribution of stablecoins across chains with a single API call.

We are going to particularly deep-dive into how to get Stablecoin Balance data in this section.

Stablecoin Balance of an Address​

Solana​

Below stream will give you balance of 9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM for FDUSD on Solana. Test the query here.

query MyQuery {
Solana {
BalanceUpdates(
where: {BalanceUpdate: {Account: {Owner: {is: "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"}}, Currency: {MintAddress: {is: "9zNQRsGLjNKwCUU5Gq5LR8beUCPzQMVMqKAi3SSZh54u"}}}}
orderBy: {descendingByField: "BalanceUpdate_Balance_maximum"}
) {
BalanceUpdate {
Balance: PostBalance(maximum: Block_Slot)
Currency {
Name
Symbol
}
}
}
}
}

Ethereum​

Run Query

query {
EVM(network: eth, dataset: combined) {
Balances(
where: {
Balance: {
Address: {
is: "0xcf1DC766Fc2c62bef0b67A8De666c8e67aCf35f6"
}
}
}
) {
Currency {
Symbol
SmartContract
}
Balance {
Amount(selectWhere: { gt: "0" })
AmountInUSD
}
}
}
}

Tron​

Below query will give you USDT balance for address TUTQj7VJ1QjR3t2GJByvrP25yZNFcj38VJ on Tron.

query MyQuery {
Tron(dataset: combined) {
Balances(
where: {Balance: {Address: {is: "TUTQj7VJ1QjR3t2GJByvrP25yZNFcj38VJ"}}, Currency: {SmartContract: {is: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"}}}
) {
Currency {
Name
}
Balance {
Address
Amount(selectWhere: {gt: "0"})
}
}
}
}

More examples on balances on EVM chains can be found here

Token holder API examples can be found here

Get Top 100 Holders of a Particular Stablecoin​

This query returns the top 100 holders of a particular Stablecoin.

query MyQuery {
Solana {
BalanceUpdates(
orderBy: {descendingByField: "BalanceUpdate_Holding_maximum"}
where: {BalanceUpdate: {Currency: {MintAddress:
{is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}},
}, Transaction: {Result: {Success: true}}}
) {
BalanceUpdate {
Currency {
Name
MintAddress
Symbol
}
Account {
Address
}
Holding: PostBalance(maximum: Block_Slot selectWhere:{gt:"0"})
}
}
}
}
Build with Bitquery

Ready to run this in production?

Get an API key and run these queries in minutes, or talk to us about plans and enterprise delivery.