maybeyonasmoonbirds_buy_sell_net
    Updated 2022-04-30
    with
    first_sell as (
    select
    event_inputs:from::string as seller,
    min(block_timestamp) as first_sale
    from ethereum_core.fact_event_logs
    where contract_address = '0x23581767a106ae21c074b2276d25e5c3e136a68b'
    and event_name = 'Transfer'
    and event_inputs:from::string != '0x0000000000000000000000000000000000000000'
    group by 1
    ),
    first_buy as (
    select
    event_inputs:to::string as buyer,
    min(block_timestamp) as first_buy
    from ethereum_core.fact_event_logs
    where contract_address = '0x23581767a106ae21c074b2276d25e5c3e136a68b'
    and event_name = 'Transfer'
    -- and event_inputs:from::string != '0x0000000000000000000000000000000000000000'
    group by 1
    ),
    daily_sell as (
    select
    date(first_sale) as sell_date,
    count(distinct seller) as sellers
    from first_sell
    group by 1
    ),
    daily_buy as (
    select
    date(first_buy) as buy_date,
    count(distinct buyer) as buyers
    from first_buy
    group by 1
    )

    Run a query to Download Data