Afonso_DiazUser Classification
    Updated 2025-04-22
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    from_address as user,
    tx_fee,
    iff(origin_function_signature = '0xe884624b', 'GM to a Fren', 'GM') as tx_type
    from
    ink.core.fact_transactions
    where
    tx_succeeded
    and to_address = '0x9f500d075118272b3564ac6ef2c70a9067fd2d3f'
    and origin_function_signature in ('0xe884624b', '0xc0129d43')
    ),

    users as (
    select
    user,
    count(distinct tx_hash) as transactions
    from
    main
    group by 1
    )

    select
    case
    when transactions = 1 then 'Occasional User (1 Transaction)'
    when transactions <= 5 then 'Casual User (2 - 5 Transactions)'
    when transactions <= 10 then 'Moderate User (6 - 10 Transactions)'
    when transactions <= 25 then 'Active User (11 - 25 Transactions)'
    when transactions <= 50 then 'Frequent User (26 - 50 Transactions)'
    else 'Power User (More than 50 Transactions)'
    end as user_category,
    count(distinct user) as users
    QueryRunArchived: QueryRun has been archived