Afonso_Diazgrouping by label
    Updated 2024-10-22
    with

    transactions as (
    select
    tx_hash,
    block_timestamp,
    receiver_id as contract_address,
    tx_signer as user,
    transaction_fee / 1e24 as tx_fee
    from near.core.fact_actions_events_function_call
    join near.core.fact_transactions
    using(tx_hash)
    )

    select
    label_type,
    count(distinct contract_address) as contracts,
    count(distinct tx_hash) as transactions,
    count(distinct user) as users,
    sum(tx_fee) as total_fee
    from transactions
    join near.core.dim_address_labels
    on address = contract_address
    where block_timestamp::date between '{{ start_date }}' and '{{ end_date }}'
    group by 1
    order by transactions desc
    limit 10

    QueryRunArchived: QueryRun has been archived