hessTop 30 Projects Based on number of new suers copy copy
    Updated 2024-03-26
    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_project,
    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_project as PROJECT_NAME,
    count(DISTINCT user) as "New Users"
    from new
    where min_date::date >= '2024-01-01'
    group by 1
    order by 2 desc
    limit 10

    QueryRunArchived: QueryRun has been archived