address stats in v2

Returns 10 transactions and transfers on BNB Chain, where block time since 2023-05-25 and block time till 2024-05-25: block time, unique of block date, call count, sum of transfer amount in USD, unique of transfer receiver, unique of transaction hash, unique of transfer currency smart contract and unique of transfer sender.

By Akshat · saved 4 November 2024 · Bitquery API v2

What it returns

Filters

The query

query MyQuery($address: String, $sinceTime: DateTime, $tillTime: DateTime) {
  EVM(network: bsc, dataset: archive) {
    Transactions(
      limit: {count: 10}
      where: {any: [{Transaction: {From: {is: $address}}}, {Transaction: {To: {is: $address}}}], Block: {Time: {since: $sinceTime, till: $tillTime}}}
    ) {
      firstTxAt: Block {
        Time(minimum: Block_Time)
      }
      lastTxAt: Block {
        Time(maximum: Block_Time)
      }
      daysWithTransactions: uniq(of: Block_Date)
      callTxCount: Transaction {
        CallCount
      }
    }
    Transfers(
      where: {any: [{Transfer: {Receiver: {is: $address}}}, {Transfer: {Sender: {is: $address}}}], Block: {Time: {since: $sinceTime, till: $tillTime}}}
    ) {
      sendAmount: sum(
        of: Transfer_AmountInUSD
        if: {Transfer: {Sender: {is: $address}}}
      )
      sendToCount: uniq(
        of: Transfer_Receiver
        if: {Transfer: {Sender: {is: $address}}}
      )
      sendTxCount: uniq(
        of: Transaction_Hash
        if: {Transfer: {Sender: {is: $address}}}
      )
      sendToCurrencies: uniq(
        of: Transfer_Currency_SmartContract
        if: {Transfer: {Sender: {is: $address}}}
      )
      receiveAmount: sum(
        of: Transfer_AmountInUSD
        if: {Transfer: {Receiver: {is: $address}}}
      )
      receiveFromCount: uniq(
        of: Transfer_Sender
        if: {Transfer: {Receiver: {is: $address}}}
      )
      receiveTxCount: uniq(
        of: Transaction_Hash
        if: {Transfer: {Receiver: {is: $address}}}
      )
      receiveFromCurrencies: uniq(
        of: Transfer_Currency_SmartContract
        if: {Transfer: {Receiver: {is: $address}}}
      )
      firstTransferAt: Block {
        Time(minimum: Block_Time)
      }
      lastTransferAt: Block {
        Time(maximum: Block_Time)
      }
      daysWithReceived: uniq(
        of: Block_Date
        if: {Transfer: {Receiver: {is: $address}}}
      )
      daysWithSent: uniq(
        of: Block_Date
        if: {Transfer: {Sender: {is: $address}}}
      )
      daysWithTransfers: uniq(of: Block_Date)
    }
  }
}

Variables

{
  "address": "0x175d44451403Edf28469dF03A9280c1197ADb92c",
  "sinceTime":"2023-05-25T00:00:00Z",
  "tillTime": "2024-05-25T00:00:00Z"
}

Similar queries