cheeyoung-kekCryptopunk Sales and Traders 3
    Updated 2022-08-31
    with


    sales as(

    select
    date_trunc('day', block_timestamp) as day,
    price as price_eth,
    price_usd,
    tx_hash
    from ethereum.core.ez_nft_sales
    where project_name = 'cryptopunks'
    and block_timestamp >= current_date() - interval '3 months'
    and event_type = 'sale'
    and buyer_address != '0x0000000000000000000000000000000000000000'
    and nft_address in ('0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb', '0xb7f7f6c52f2e2fdb1963eab30438024864c313f6')
    and currency_symbol = 'ETH'
    and price >0 and price_usd >0
    ),

    raw as(

    select
    day,
    count(DISTINCT tx_hash) as tx_count,
    sum(price_eth) as eth,
    sum(price_usd) as USD,
    sum(tx_count) over (order by day) as cum_sales,
    sum(USD) over (order by day) as cum_sales_usd
    from sales
    group by 1

    )

    select * from raw
    Run a query to Download Data