NavidCopy of Copy of Copy of Untitled Query
    Updated 2022-12-05
    with prices as (
    select
    date(timestamp) as day,
    avg(price_usd) as priceusd
    from
    flow.core.fact_prices
    where
    token='Flow'
    group by
    1
    )
    select
    nft_collection,
    split_part(nft_collection, '.', 3) as collection_name,
    count(distinct SELLER) as "Sellers Count",
    count(distinct BUYER) as "Buyers Count",
    count(distinct TX_ID) as "Sales Count",
    sum(PRICE*priceusd) as "Volume",
    "Sellers Count"/"Buyers Count" as "Relative Strength of Buyers to Sellers"
    from
    flow.core.ez_nft_sales s join prices p on date(block_timestamp)=p.day
    where
    TX_SUCCEEDED -- and block_timestamp > CURRENT_DATE-90
    group by 1
    order by
    "Volume" desc
    limit 50
    Run a query to Download Data