mlhUntitled Query
    Updated 2023-01-05
    select case when user1 in (select Active_User
    from (select signers[0] as Active_User,
    count (distinct tx_id) as trxs
    from solana.core.fact_transactions
    where block_timestamp >= CURRENT_DATE - 30--defining active user as user that had more than 3 trxs in recent 30 days
    group by 1 having tx_count > 3
    )
    ) then 'active holder'
    else 'Non active holder' end as type,
    count (distinct User1)
    from (select date,
    User1,
    sum (Volume) as Net_Volume,
    sum (Net_Volume) over (partition by User1 order by date rows between unbounded preceding and current row) as User_Net_Volume
    from (select block_timestamp::date as date,
    tx_from as User1,
    sum (amount)*-1 as Volume
    from solana.core.fact_transfers
    where mint = 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263'
    group by 1,2

    union ALL

    select block_timestamp::Date as date,
    tx_to as User1,
    sum (amount) as Volume
    from solana.core.fact_transfers
    where mint = 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263'
    group by 1,2
    )
    group by 1,2
    )
    group by 1
    Run a query to Download Data