farid-c9j0VMalgo3-one after
    Updated 2022-12-05
    with price as (
    select
    timestamp::date as day,
    avg(price_usd) as flow_price
    from flow.core.fact_prices
    where token_contract = 'A.1654653399040a61.FlowToken'
    group by 1
    ),
    base as (
    select
    *,
    case
    when currency in ('A.ead892083b3e2c6c.FlowUtilityToken', 'A.1654653399040a61.FlowToken') then price * flow_price else price end as nft_price
    from flow.core.ez_nft_sales join price on block_timestamp::date = day
    where
    nft_collection = 'A.e4cf4bdc1751c65d.AllDay' and tx_succeeded = 'TRUE'
    )
    select
    case
    when nft_price <=2 then 'less than $2'
    when nft_price between 2 and 5 then'between $2 and $5'
    when nft_price between 2 and 5 then 'between $2 and $5'
    when nft_price between 5 and 10 then 'between $5 and $10'
    when nft_price between 10 and 20 then 'between $10 and $20'
    when nft_price between 20 and 50 then 'between $20 and $50'
    when nft_price between 50 and 100 then 'between $50 and $100'
    else 'more than $100' end as category,
    count(distinct tx_id) as sales_count,
    count(distinct buyer) as unique_buyer,
    count(distinct seller) as unique_seller,
    sum(nft_price) as sale_volume
    from base
    where block_timestamp >= '2022-11-24' and block_timestamp <='2022-12-01'
    group by 1


    Run a query to Download Data