Afonso_DiazGrouping txns
    Updated 2025-04-25
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    args:amount / 1e6 as amount,
    amount as amount_usd,
    args:receiver_id as user
    from
    near.core.fact_actions_events_function_call
    where
    predecessor_id = 'aurora'
    and signer_id = 'relay.aurora'
    and receipt_succeeded
    and receiver_id = '17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1'
    and tx_hash in (select distinct tx_hash from near.core.fact_actions_events_function_call where logs::string ilike '%0xe93685f3bba03016f02bd1828badd6195988d950%')
    )

    select
    case
    when amount < 10 then '< $10'
    when amount <= 50 then '$10 - $50'
    when amount <= 100 then '$50 - $100'
    when amount <= 500 then '$100 - $500'
    when amount <= 1000 then '$500 - $1,000'
    when amount <= 5000 then '$1,000 - $5,000'
    when amount <= 10000 then '$5,000 - $10,000'
    when amount <= 100000 then '$10,000 - $100,000'
    else '> $100,000'
    end as type,
    count(distinct tx_hash) as transactions
    from
    main
    group by 1
    order by 1

    Last run: 12 days ago
    TYPE
    TRANSACTIONS
    1
    $1,000 - $5,000107
    2
    $10 - $502371
    3
    $10,000 - $100,00016
    4
    $100 - $500165
    5
    $5,000 - $10,00021
    6
    $50 - $100105
    7
    $500 - $1,00057
    8
    < $101134
    8
    169B
    657s