CartanGroupDaily Market Share by NFT Marketplace copy
    Updated 2023-05-02
    -- forked from kellen / Daily Market Share by NFT Marketplace @ https://flipsidecrypto.xyz/kellen/q/market-share-by-nft-marketplace-ZTcJyq

    WITH t0 AS (
    SELECT date_trunc('day', block_timestamp)::date AS date
    , CASE
    WHEN marketplace LIKE 'magic%' THEN 'B. Magic Eden'
    WHEN marketplace LIKE 'tensorswap' THEN 'A. Tensor'
    ELSE 'C. Others' END AS marketplace
    , SUM(sales_amount) AS volume
    FROM solana.core.fact_nft_sales s
    WHERE date >= CURRENT_DATE - 27
    AND succeeded
    AND sales_amount < 10000
    GROUP BY 1, 2
    )
    SELECT *
    , SUM(volume) OVER (PARTITION BY date) AS tot_volume
    , ROUND(100 * volume / tot_volume, 1) AS pct_volume
    FROM t0
    ORDER BY marketplace



    Run a query to Download Data