drone-mostafaUntitled Query
    Updated 2022-09-28
    with userss as (
    select 'buyers' as type ,PURCHASER, BLOCK_TIMESTAMP from solana.core.fact_nft_sales
    UNION ALL
    select 'sellers' as type ,SELLER , BLOCK_TIMESTAMP from solana.core.fact_nft_sales )

    select
    MARKETPLACE,
    sum(sales_amount) as Volume,
    count(distinct(tx_id)) as Txn,
    count(distinct(b.PURCHASER)) as Users,
    date_trunc ('day', a.block_timestamp) as Date,
    sum (Volume) over (partition by MARKETPLACE order by date ) as cum_Volume,
    sum (Txn) over (partition by MARKETPLACE order by date ) as cum_Txn,
    sum (Users) over (partition by MARKETPLACE order by date ) as cum_Users
    from solana.core.fact_nft_sales a join userss b on a.BLOCK_TIMESTAMP=b.BLOCK_TIMESTAMP
    where Date >= CURRENT_DATE -90 and Date < CURRENT_DATE and succeeded = 'TRUE'
    and marketplace in ('yawww', 'solanart', 'magic eden v2')
    group by Date,MARKETPLACE

    Run a query to Download Data