SniperRe7-2
    Updated 2022-10-29
    with Base as (
    select block_timestamp,
    tx_hash,
    event_inputs:to as Buyer,
    event_inputs:from as Seller,
    event_inputs:Token_ID as Token_ID
    from polygon.core.fact_event_logs
    where block_timestamp::date between '2021-08-15' and '2021-11-15'
    and event_inputs:tokenId is not null
    and event_name = 'Transfer'
    and tx_status = 'SUCCESS'
    and event_inputs:from != '0x0000000000000000000000000000000000000000'
    and event_inputs:to != '0x0000000000000000000000000000000000000000'
    and contract_address = '0x8634666ba15ada4bbc83b9dbf285f73d9e46e4c2')

    select 'Chicken Derby' as collection,
    date_trunc('DAy', block_timestamp) Date,
    count (distinct tx_hash) as Sales_Count,
    count (distinct buyer) as Buyers_Count,
    count (distinct Seller) as Sellers_Count,
    count (distinct Token_ID) as Tokens_Count,
    sum (sales_count) over (order by date) as Cum_Sales_Count,
    sum (Buyers_Count) over (order by date) as Cum_Buyers_Count,
    sum (Sellers_Count) over (order by date) as Cum_Sellers_Count,
    sum (Tokens_Count) over (order by date) as Tokens_Count
    from Base
    group by 1,2

    Run a query to Download Data