adriaparcerisasdau near nft 2
    Updated 2024-11-18
    WITH
    daus as (
    SELECT
    distinct tx_signer as users,
    trunc(block_timestamp,'week') as weeks,
    count(distinct trunc(block_timestamp,'day')) as active_days
    from near.core.fact_transactions
    group by 1,2
    having active_days>=4
    ),
    active_users as (
    SELECT
    distinct tx_signer,
    tx_receiver,
    min(x.block_timestamp) as debut
    from near.core.fact_transactions x
    where tx_signer in (select users from daus)
    group by 1,2
    )
    select
    trunc(debut,'week') as date,
    project_name,
    count(distinct tx_signer) as n_users,
    sum(n_users) over (partition by project_name order by date) as total_n_users
    from active_users x
    join near.core.dim_address_labels y on x.tx_receiver=y.address
    where date>=current_date-interval '{{Months}} MONTHS' and label_type='nft'
    group by 1,2
    order by 1 asc



    QueryRunArchived: QueryRun has been archived