Hadisehwhat 1
    Updated 2022-07-26
    with t1 as (select trunc(block_timestamp,'day') as date , y.play_type ,
    count(DISTINCT x.tx_id) as sales_number ,
    sum(x.price) as total_amount
    from flow.core.fact_nft_sales x join flow.core.dim_topshot_metadata y on x.nft_id = y.nft_id
    where x.nft_collection like '%TopShot%' and x.tx_succeeded = 'TRUE'
    group by 1,2
    order by 1)
    ,
    t2 as ( select trunc(timestamp,'day') as date_ , avg(price_usd) as total_price
    from flow.core.fact_prices
    where symbol = 'FLOW' and TOKEN = 'Flow' and timestamp::date >= '2022-04-20'
    group by 1)

    select date , total_price ,play_type , sales_number , total_amount , total_amount*total_price as total_volume
    from t2 x left join t1 y on x.date_ = y.date
    Run a query to Download Data