mboveiriCrypto Punk 1
    Updated 2022-08-31
    with price_ as
    (
    select
    block_timestamp::date as date,
    round(avg(price)) as sale_price
    from ethereum.core.ez_nft_sales
    where nft_address = lower('0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb')
    and price > 0 and event_type = 'sale'
    and tx_hash != '0x92488a00dfa0746c300c66a716e6cc11ba9c0f9d40d8c58e792cc7fcebf432d0' -- Falsely raise the price transaction hash.
    and block_timestamp >= current_date - 120
    group by 1 )

    , holders as
    (select
    balance_date::date as date,
    count(distinct user_address) as holder_count,
    count(case when balance between 1 and 5 then 1 end) as "1-5 cPunks Ͼ",
    count(case when balance between 5 and 20 then 1 end) as "5-20 cPunks Ͼ",
    count(case when balance between 20 and 50 then 1 end) as "20-50 cPunks Ͼ",
    count(case when balance between 50 and 100 then 1 end) as "50-100 cPunks Ͼ",
    count(case when balance > 100 then 1 end) as " > 100 cPunks Ͼ"
    from flipside_prod_db.ethereum.erc20_balances
    where contract_address=lower('0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb')
    and balance_date >= current_date - 120
    group by 1)

    select
    *
    from holders left join price_ on holders.date = price_.date
    where sale_price > 0
    Run a query to Download Data