Afonso_DiazGrouping users
    Updated 2025-04-06
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    from_address as user
    from
    swell.core.fact_transactions
    where
    tx_succeeded
    ),

    user_tx_counts as (
    select
    user,
    count(distinct tx_hash) as tx_count
    from
    main
    group by user
    )

    select
    case
    when tx_count >= 100 then '🔥 Power User (100+ txns)'
    when tx_count between 50 and 99 then '⚡ Heavy User (50-99 txns)'
    when tx_count between 20 and 49 then '🚀 Active User (20-49 txns)'
    when tx_count between 5 and 19 then '🐣 Casual User (5-19 txns)'
    when tx_count between 1 and 4 then '🍼 Newbie (1-4 txns)'
    else '❓ Unknown'
    end as user_category,
    count(*) as user_count
    from
    user_tx_counts
    group by 1
    order by user_count desc

    Last run: 28 days ago
    USER_CATEGORY
    USER_COUNT
    1
    🍼 Newbie (1-4 txns)11408
    2
    🐣 Casual User (5-19 txns)3073
    3
    🚀 Active User (20-49 txns)425
    4
    🔥 Power User (100+ txns)157
    5
    ⚡ Heavy User (50-99 txns)135
    5
    182B
    3s