hessWeekly New Users Per project type copy
    Updated 2024-03-28
    -- forked from Weekly New Users Per project type @ https://flipsidecrypto.xyz/edit/queries/b3ed641e-50e8-49f2-9c2e-d8603da65008

    with label_type as ( select 'storage.herewallet.near' as address,
    'Here' as PROJECT_NAME,
    'Here'as address_name,
    'Defi' as label_type
    from near.core.dim_address_labels
    UNION all
    select 'game.hot.tg' as address,
    'Hot' as project_name,
    'Hot' as address_name,
    'Game' as label_type,
    UNION all
    select address,
    PROJECT_NAME,
    address_name,
    label_type
    from near.core.dim_address_labels)
    ,
    new as ( select min(block_timestamp) as min_date,
    min(project_name) as min_label,
    signer_id as user
    from near.core.fact_actions_events_function_call a join label_type b on a.receiver_id = b.address
    where signer_id not in (select address from near.core.dim_address_labels)
    and RECEIPT_SUCCEEDED = 'TRUE'
    and label_type not in ('token_contract','chadmin','cex','operator','token')
    group by 3)


    select
    min_label,
    count(DISTINCT user) as "New Users"
    from new
    where min_date::date >= '2024-01-01'
    group by 1

    QueryRunArchived: QueryRun has been archived