Ali3NActivity of Claynosaurz Holders Within Solana Chain Over Time
    Updated 2023-03-21
    with claynosaurzt as (select * from solana.core.dim_labels where label = 'claynosaurz'),

    receivet as (
    select block_timestamp as receive_date,
    purchaser as receiver,
    mint
    from solana.core.fact_nft_mints
    where mint in (select distinct address from claynosaurzt)

    union ALL

    select block_timestamp as receive_date,
    purchaser,
    mint
    from solana.core.fact_nft_sales
    where mint in (select distinct address from claynosaurzt)),

    salest as (
    select block_timestamp as sale_date,
    t1.mint,
    t1.seller
    from solana.core.fact_nft_sales t1 join receivet t2 on t1.seller = t2.receiver and t1.mint = t2.mint and t1.block_timestamp > t2.receive_date
    where t1.mint in (select distinct address from claynosaurzt)),

    holderst as (
    select distinct receiver
    from receivet
    where receiver not in (select distinct seller from salest))

    select date_Trunc ({{Date_Trunc}},block_timestamp) as date,
    count (Distinct tx_id) as TX_Count,
    count (distinct receiver) as Active_users
    from solana.core.fact_transactions t1 join holderst t2 on t1.signers[0] = t2.receiver
    group by 1
    order by 1
    Run a query to Download Data