Flipside TeamTrends: Sales, buyers, sellers and price
    Updated 2024-09-12
    -- forked from MLDZMN / Trends: Sales, buyers, sellers and price @ https://flipsidecrypto.xyz/MLDZMN/q/oLMwCoD17DWd/trends-sales-buyers-sellers-and-price

    --- First recorded date 2017-06-23 21:05:06.000
    --- First recorded block for NFT sale 3919706
    --- First recorded price 2020-05-05 aacording to price tables: before than "Price USD" is null
    select
    date_trunc('{{Interval}}', block_timestamp) as date,
    count(distinct tx_hash) as "Sales",
    count(distinct BUYER_ADDRESS) as "Buyers",
    count(distinct SELLER_ADDRESS) as "Sellers",
    count(distinct PROJECT_NAME) as "Collections",
    count(distinct TOKENID) as "Sold NFTs",
    round(sum(price_usd), 3) as "Volume USD",
    round(sum(CREATOR_FEE_USD), 3) as "Royalty fee USD",
    round(sum(PLATFORM_FEE_USD), 3) as "Platform fee USD",
    round(avg(price_usd), 3) as "Avg price USD",
    round(Median(price_usd), 3) as "Median price USD",
    from
    ethereum.nft.ez_nft_sales
    where
    BLOCK_TIMESTAMP >= '{{Start_date}}'
    group by
    date
    order by
    date desc


    QueryRunArchived: QueryRun has been archived