Coin Official Streaming Query For Token Holders Beta

This utilises the https://streaming.bitquery.io/graphql It is using a combined dataset due to the lack of realtime streaming ability, until bitquery renovates their realtime datasets for tokens an archived approach will have to work and will be labelled beta on the homepage. The alternate is using a BSC Scan API endpoint. However $200 a month for just token holder data on just BSC scan is out of budget. Will be considered at a later stage.

By Faizel · saved 30 March 2023 · run 30 times · Bitquery API v2

What it returns

Filters

The query

query($network: evm_network, $dataset: dataset_arg_enum, $token: String!, $limit: Int!){
  EVM(network: $network, dataset: $dataset) {
    BalanceUpdates(
      limit: {count: $limit}
      orderBy: {descendingByField: "balance"}
      where: {Currency: {SmartContract: {is: $token}}}
    ) {
      BalanceUpdate {
        Address
      }
      balance: sum(of: BalanceUpdate_Amount)
    }
  }
}

Variables

{
"network": "bsc",
"dataset": "combined",
"limit": 10,
"token": "0x17f1b7f7d9bb1d17ce01561dc4de658d4c343910"	
}

Similar queries