messariNEAR Dapps per Address Q2'23
    Updated 2023-07-03
    with
    contracts as (
    select
    distinct t.tx_receiver as address,
    case
    when l.project_name is not null then l.project_name
    else t.tx_receiver
    end as contract_group
    from
    near.core.fact_transactions t
    left join
    near.core.dim_address_labels l
    on t.tx_receiver = l.address
    ),
    dapps_per_address as (
    select
    t.tx_signer as address,
    count(distinct c.contract_group) as unique_dapps
    from
    near.core.fact_transactions t
    left join
    contracts c
    on t.tx_receiver = c.address
    where
    date(t.block_timestamp) between '{{Start_date}}' and '{{End_date}}'
    group by 1
    )
    select
    unique_dapps as dapps_interacted_with,
    count(unique_dapps) as number_of_addresses
    from
    dapps_per_address
    group by 1
    order by 1 asc
    Run a query to Download Data