Smart Contract balance by currencies

Returns one balance update on Ethereum, where balance update address is 0xc02a…6cc2, currency smart contract is 0xc02a…6cc2 and currency smart contract is not 0x, sorted by sum, highest first: chain ID, count, currency symbol, smart contract, currency name, sum of balance update amount and sum of balance update amount in USD.

By Nadia · saved 18 February 2025 · run 28 times · Bitquery API v2

What it returns

Filters

The query

query ($network: evm_network, $address: String!) {
  EVM(network: $network, dataset: archive) {
    BalanceUpdates(
      orderBy: {descendingByField: "sum"}
      where: {BalanceUpdate: {Address: {is: $address}}, Currency: {SmartContract: {not: "0x"}}}
    ) {
      ChainId
      count
      Currency {
        Symbol
        SmartContract
        Name
      }
      sum(of: BalanceUpdate_Amount, selectWhere: {gt: "0.0"})
      sum_usd: sum(of: BalanceUpdate_AmountInUSD, selectWhere: {gt: "0.0"})
    }
    Transfers(
      limit: {count: 1}
      where: {Transfer: {Currency: {SmartContract: {is: $address}}}}
    ) {
      Transfer {
        Currency {
          Name
          Symbol
          SmartContract
        }
      }
    }
  }
}

Variables

{
  "offset": 0,
  "network": "eth",
  "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
}

Similar queries