getTokenBalances

Returns 100 balance updates on Ethereum, where balance update address is 0xaFD4…DC56, sorted by amount, highest first: chain ID, currency symbol, smart contract and sum of balance update amount.

By Jose · saved 26 September 2024 · run 26 times · Bitquery API v2

What it returns

Filters

The query

query getTokenBalances($dataset: dataset_arg_enum!, $network: evm_network, $wallet: String!, $limit: Int) {
  EVM(dataset: $dataset, network: $network) {
    BalanceUpdates(
      limit: { count: $limit }
      orderBy: { descendingByField: "Amount" }
      where: { BalanceUpdate: { Address: { is: $wallet } }, Currency: { Fungible: true } }
    ) {
      ChainId
      Currency {
        Symbol
        SmartContract
      }
      # Prevent pull token with small amounts
      Amount: sum(of: BalanceUpdate_Amount, selectWhere: { gt: "0.001" })
    }
  }
}

Variables

{
  "dataset": "combined",
  "network": "eth",
  "wallet": "0xaFD4f1F2266d72E2dCa2E362a61Fa186b2CFDC56",
  "limit": 100
}

Similar queries