Hemintest
    Updated 2022-12-03
    with pricet as (
    select timestamp::date as day,
    avg (price_usd) as usdprice
    from flow.core.fact_prices
    where symbol = 'FLOW'
    and source = 'coinmarketcap'
    group by 1),

    maintable as (
    select block_timestamp::date as date,
    player,
    count (distinct tx_id) as Sales_Count,
    count (distinct buyer) as Buyers_Count,
    count (distinct seller) as Sellers_Count,
    count (distinct t1.nft_id) as NFTs_Count,
    sum (case when currency = 'A.1654653399040a61.FlowToken' then price*usdprice else price end) as Total_USD_Volume,
    avg (case when currency = 'A.1654653399040a61.FlowToken' then price*usdprice else price end) as Average_USD_Volume,
    median (case when currency = 'A.1654653399040a61.FlowToken' then price*usdprice else price end) as Median_USD_Volume,
    min (case when currency = 'A.1654653399040a61.FlowToken' then price*usdprice else price end) as Minimum_USD_Volume,
    max (case when currency = 'A.1654653399040a61.FlowToken' then price*usdprice else price end) as Maximum_USD_Volume
    from flow.core.ez_nft_sales t1 join pricet t2 on t1.block_timestamp::Date = t2.day
    join flow.core.dim_allday_metadata t3 on t1.nft_id = t3.nft_id
    where t1.nft_collection = 'A.e4cf4bdc1751c65d.AllDay'
    and tx_succeeded = 'TRUE'
    and block_timestamp >= '2022-11-24'
    group by 1,2),

    finaltable as (
    select *,
    row_number() over (partition by date order by Sales_Count desc) as RN
    from maintable)

    select * from finaltable
    where RN <= 5
    and player != 'N/A'
    order by date
    Run a query to Download Data