Flipside CommunityEthereum Wrapped (part 1)
    Updated 2025-02-04
    /*
    Charlie Changelog 2024-01-10
    - rewrote for speed
    - re-ordered to exclude double counts
    */

    with acquired_2023_tx_counts AS (
    select e1.from_address,
    max(e2.nonce)+1 as n_tx,
    case
    when n_tx >= 100 then '100+'
    when n_tx >= 50 then '50-99'
    when n_tx >= 20 then '20-49'
    when n_tx >= 5 then '5-19'
    else '< 5' end as tx_category
    from ethereum.core.fact_transactions e1
    left join ethereum.core.fact_transactions e2 USING (from_address)
    where e1.block_timestamp::date >='2023-01-01'
    and e1.block_timestamp::date < '2024-01-01'
    and e1.nonce = 1
    group by from_address
    )

    select 'all acquired' as type, (select count(from_address) from acquired_2023_tx_counts) as number_of_users
    union all
    select '< 5 tx' as type,(select count(from_address) from acquired_2023_tx_counts where tx_category = '< 5') as number_of_users
    union all
    select '5-19 tx' as type,(select count(from_address) from acquired_2023_tx_counts where tx_category = '5-19') as number_of_users
    union all
    select '20-49 tx' as type,(select count(from_address) from acquired_2023_tx_counts where tx_category = '20-49') as number_of_users
    union all
    select '50-99 tx' as type,(select count(from_address) from acquired_2023_tx_counts where tx_category = '50-99') as number_of_users
    union all
    select '100+ tx' as type,(select count(from_address) from acquired_2023_tx_counts where tx_category = '100+') as number_of_users


    Last run: 3 months ago
    TYPE
    NUMBER_OF_USERS
    1
    all acquired15408536
    2
    < 5 tx9574751
    3
    5-19 tx4281302
    4
    20-49 tx961347
    5
    50-99 tx312411
    6
    100+ tx278725
    6
    125B
    646s