Updated 2024-12-04
    -- Credit: https://flipsidecrypto.xyz/mo115/q/JWkIy9m88BuC/a-h
    -- Analyst: mo115


    select --date_trunc('day', BLOCK_TIMESTAMP) as date
    --, MARKETPLACE
    count (distinct TX_ID) as Sales
    , count (distinct PURCHASER) as Buyers
    , count (distinct SELLER) as Sellers
    , count (distinct s.mint) as "Traded NFTs"
    , sum(SALES_AMOUNT) as Volume
    , avg(SALES_AMOUNT) as "Average Price"
    , median(SALES_AMOUNT) as "Median Price"
    , count (distinct NFT_COLLECTION_NAME) as "Traded Collections"
    from solana.nft.fact_nft_sales s left join solana.nft.dim_nft_metadata d on s.mint=d.mint
    where BLOCK_TIMESTAMP::date >= current_date - 31
    and BLOCK_TIMESTAMP::date < current_date
    and SUCCEEDED = 'TRUE';
    QueryRunArchived: QueryRun has been archived