MLDZMNonp6
    Updated 2022-10-18
    with owner as (
    select * from (
    SELECT
    block_timestamp,
    tx_hash,
    TOKENID as mint,
    BUYER_ADDRESS as purchaser,
    price as amount,
    row_number() over(PARTITION BY TOKENID ORDER BY block_timestamp desc) rn,
    case
    when price>0 and price<=0.01 then 'a. < 0.01 ETH'
    when price>0.01 and price<=0.1 then 'b. 0.01-0.1 ETH'
    when price>0.1 and price<=1 then 'c. 0.1-1 ETH'
    when price>1 and price<=10 then 'd. 1-10 ETH'
    when price>10 then 'e. > 10ETH'
    end as bucket
    from optimism.core.ez_nft_sales
    where PLATFORM_NAME='quixotic'
    and EVENT_TYPE='sale'
    and CURRENCY_SYMBOL='ETH'
    and amount > 0
    ) where rn = 1 order by block_timestamp desc
    )


    select
    case when bear_owned = 1 then 'a. 1 NFT'
    when bear_owned = 2 then 'b. 2 NFTs'
    when bear_owned = 3 then 'c. 3 NFTs'
    when bear_owned >= 4 then 'd. over 4 NFTs'
    end as owner_type,
    bucket,
    count(owner_type) as total
    from (
    select count(mint) as bear_owned,
    purchaser,
    Run a query to Download Data