Elprognerd7- top collections #buyers
    Updated 2023-03-17
    WITH
    price_t AS (
    SELECT
    recorded_hour::date as date1,
    AVG(close) as price
    FROM
    solana.core.fact_token_prices_hourly
    WHERE
    SYMBOL = 'SOL'
    GROUP BY
    1
    )
    SELECT
    PROJECT_NAME,
    COUNT(distinct TX_ID) as "Number of Sales",
    SUM(SALES_AMOUNT * price) as "NFT Volume in USD",
    COUNT(distinct PURCHASER) as "Number of Buyers",
    COUNT(distinct SELLER) as "Number of Sellers",
    "NFT Volume in USD"/"Number of Sales" as "Average Price of Each NFT"
    FROM solana.core.fact_nft_sales x JOIN price_t y ON x.BLOCK_TIMESTAMP::date = y.date1 JOIN solana.core.dim_nft_metadata z ON x.MINT = z.MINT
    WHERE SUCCEEDED = 'true' and MARKETPLACE = 'tensorswap'
    GROUP BY
    1
    order by
    4 DESC
    LIMIT 10





    Run a query to Download Data