array_intersect example for 2 addresses

Historical data This query already reads history - it uses the archive dataset, which needs the historical data add-on for this chain. Without the add-on it fails with 'access restricted: your plan only allows realtime'. Drop the dataset argument to fall back to the recent window. Datasets: https:/

By Kshitij Mahajan · saved 24 April 2025 · run 1 time · Bitquery API v2

What it returns

Filters

The query

# Historical data
#   This query already reads history - it uses the archive dataset, which
#   needs the historical data add-on for this chain.
#
#   Without the add-on it fails with 'access restricted: your plan only allows
#   realtime'. Drop the dataset argument to fall back to the recent window.
#
# Datasets:  https://docs.bitquery.io/docs/graphql/dataset/archive/
# Retention: https://docs.bitquery.io/docs/graphql/data-coverage-retention/
#

query ($addresses: [String!]) {
  EVM(dataset: archive) {
    Transfers(
      where: {any: [{Transfer: {Sender: {in: $addresses}}}, {Transfer: {Receiver: {in: $addresses}}}], Block: {Date: {after: "2024-04-01"}}}
    ) {
      array_intersect(
        side1: Transfer_Sender
        side2: Transfer_Receiver
        intersectWith: $addresses
      )
    }
  }
}

Variables

{
  "addresses": ["0x21743a2efb926033f8c6e0c3554b13a0c669f63f","0x107f308d85d5481f5b729cfb1710532500e40217"]
}

Similar queries