CryptoIcicleMega-Optimism NFT Purchasing Behavior
    Updated 2023-11-07
    -- Optimism NFT Purchasing Behavior
    -- Show the distribution of all NFT sales on Optimism by price. What percentage of all sales have been above .01 ETH? Above .1 ETH? 1 ETH?

    -- Pay by Quality Your score determines your final payout.
    -- Grand Prize 75 USDC (A score of 11 or 12 earns you a Grand Prize title)
    -- Payout 50 USDC
    -- Score Multiplier 0-7 : 0% 8 : 50% 9 : 75% 10 : 100% 11 : 125% 12 : 150%
    -- Payout Network Ethereum
    -- Level Beginner
    -- Difficulty Medium
    -- Show the distribution of all NFT sales on Optimism by price.
    -- What percentage of all sales have been above .01 ETH? Above .1 ETH? 1 ETH?
    -- Do you think that there is a limit to how high a floor for a NFT collection on Optimism can reach compared to on Ethereum?

    -- SQL Credit: https://app.flipsidecrypto.com/velocity/queries/3f1afbda-9855-4616-8d0f-04c64c048e9c

    WITH nft_sales_optimism AS (
    SELECT block_timestamp, tx_hash, nft_address, buyer_address, seller_address, total_fees, price as prc
    FROM optimism.core.ez_nft_sales
    WHERE currency_address = 'ETH'
    and block_timestamp >= CURRENT_DATE - {{N_DAYS}}
    )

    select
    *,
    100 * ratio_to_report(num_sales) over (partition by price) as percent_sales,
    sum(vol) over (partition by price order by week asc rows between unbounded preceding and current row) as cum_vol,
    sum(num_sales) over (partition by price order by week asc rows between unbounded preceding and current row) as cum_num_sales,
    sum(n_buyers) over (partition by price order by week asc rows between unbounded preceding and current row) as cum_n_buyers
    from (
    SELECT date_trunc('{{date_range}}',block_timestamp) as week,
    CASE
    WHEN prc < 0.01 THEN 'a < 0.01 ETH'
    WHEN prc < 0.1 THEN 'b. 0.01 - 0.1 ETH'
    WHEN prc < 1 THEN 'c. 0.1 - 1 ETH'
    WHEN prc < 5 THEN 'd. 1 - 5 ETH'
    Run a query to Download Data