SalehAnalyzing NFT Collection Statistics
    Updated 2024-03-13
    with lst_min as (
    select
    buyer_address
    ,min(block_timestamp)::date as min_date
    from base.nft.ez_nft_sales
    group by 1
    )
    , lst_new_users as (
    select
    buyer_address
    from lst_min
    where min_date>=current_date-30
    group by 1
    )
    ,lst_new as (
    select
    iff(project_name is null ,'BasePaint',project_name) as collection
    ,count(tx_hash) as Trades
    ,sum(price_usd) as "$Volume"
    ,avg(price_usd) as "Average $Volume"
    from base.nft.ez_nft_sales
    where block_timestamp::date>=current_date-30
    and buyer_address in(select buyer_address from lst_new_users)
    group by 1
    order by "$Volume" desc
    )
    ,lst_normal_users as (
    select
    sum(price_usd) as "$Volume"
    from base.nft.ez_nft_sales
    where block_timestamp::date>=current_date-30
    and buyer_address not in(select buyer_address from lst_new_users)
    )
    select * from lst_new
    QueryRunArchived: QueryRun has been archived