arshiyamohebiSol Open total dist copy
    Updated 2023-05-28
    -- forked from drone-mostafa / Sol Open total dist @ https://flipsidecrypto.xyz/drone-mostafa/q/sol-open-total-VdktbH

    select
    count (DISTINCT TX_HASH ) as TXN,
    count (DISTINCT BUYER_ADDRESS ) as BUYER,
    count (DISTINCT SELLER_ADDRESS ) as Seller,
    count (distinct TOKENID) as NFT_IDs,
    SUM (PRICE_USD) AS USD,
    Median (PRICE_USD) AS avg_USD,
    CASE
    when PRICE_USD < 10 then 'Less than $10'
    when PRICE_USD BETWEEN 10 and 50 then '$10 to $50'
    when PRICE_USD BETWEEN 50 and 100 then '$50 to $100'
    when PRICE_USD BETWEEN 100 and 200 then '$100 to $200'
    when PRICE_USD BETWEEN 200 and 500 then '$200 to $500'
    when PRICE_USD BETWEEN 500 and 1000 then '$500 to $1000'
    when PRICE_USD BETWEEN 1000 and 5000 then '$1K to $5K'
    when PRICE_USD BETWEEN 5000 and 10000 then '$5K to $10K'
    else 'More than $10K' end as Dist,

    'Ethereum' as chain
    FROM ethereum.core.ez_nft_sales
    WHERE BLOCK_TIMESTAMP >= '2021-01-01'
    GROUP BY Dist
    UNION

    SELECT

    COUNT (DISTINCT TX_ID) AS TXN,
    COUNT (DISTINCT PURCHASER) AS BUYERS,
    COUNT (DISTINCT SELLER) AS SELLERS,
    COUNT (DISTINCT s.MINT) AS NFT_IDs,
    SUM (SALES_AMOUNT * price) AS USD,
    Median (SALES_AMOUNT * price) AS avg_USD,
    CASE
    when SALES_AMOUNT * price < 10 then 'Less than $10'
    Run a query to Download Data