DrsimonNUMBER OF DEGODS BUYERS AND SELLERS2-DAILY
    Updated 2022-09-08
    with degods as
    ( SELECT *
    from solana.core.dim_labels
    where ADDRESS_NAME ilike 'DeGods'
    )
    SELECT
    date_trunc('day' , BLOCK_TIMESTAMP) as date,
    COUNT(DISTINCT PURCHASER) as buyers,
    case when buyers <= 10 then 'buyers <= 10'
    when buyers <= 100 then 'buyers <= 100'
    when buyers <= 1000 then 'buyers <= 1k'
    else 'buyers > 1k' end as t_buyers,

    COUNT(DISTINCT SELLER) as sellers,
    case when sellers <= 10 then 'sellers <= 10'
    when sellers <= 100 then 'sellers <= 100'
    when sellers <= 1000 then 'sellers <= 1k'
    else 'sellers > 1k' end as t_sellers,
    sum(SALES_AMOUNT) as TOTAL_SALES_AMOUNT,
    case when TOTAL_SALES_AMOUNT <= 1000 then 'TOTAL_SALES_AMOUNT <= 1000'
    when TOTAL_SALES_AMOUNT <= 10000 then 'TOTAL_SALES_AMOUNT <= 10000'
    when TOTAL_SALES_AMOUNT <= 20000 then 'TOTAL_SALES_AMOUNT <= 20000'
    when TOTAL_SALES_AMOUNT <= 100000 then 'TOTAL_SALES_AMOUNT <= 100k'
    else 'SALES_AMOUNT > 100k' end as t_SALES_AMOUNT,
    sum(TOTAL_SALES_AMOUNT) over (order by date) as CUM_SALES_AMOUNT,
    case when CUM_SALES_AMOUNT <= 10000 then 'CUM_SALES_AMOUNT <= 10000'
    when CUM_SALES_AMOUNT <= 100000 then 'CUM_SALES_AMOUNT <= 100000'
    when CUM_SALES_AMOUNT <= 500000 then 'CUM_SALES_AMOUNT <= 500000'
    when CUM_SALES_AMOUNT <= 1000000 then 'CUM_SALES_AMOUNT <= 1m'
    else 'CUM_SALES_AMOUNT > 1m' end as t_CUM_SALES_AMOUNT,
    COUNT(DISTINCT tx_id) as n_tx
    from solana.core.fact_nft_sales
    where MINT in (SELECT address from degods)
    GROUP by date
    Run a query to Download Data