LittlerDataUser Arrival to NFL Allday
    Updated 2022-09-14

    with first_trade as (
    select
    min(date_trunc('day',block_timestamp)) as first_record,
    buyer
    from flow.core.ez_nft_sales
    where flow.core.ez_nft_sales.nft_collection ILIKE 'A.e4cf4bdc1751c65d.AllDay'
    group by 2
    ),

    new_address as (
    select
    first_record,
    count(*) as new_address
    from first_trade
    group by 1
    ),

    total_address as (
    select
    date_trunc('day',block_timestamp) as day,
    count(distinct buyer) as total_address
    from flow.core.ez_nft_sales
    where flow.core.ez_nft_sales.nft_collection ILIKE 'A.e4cf4bdc1751c65d.AllDay'
    group by 1
    )

    select
    day,
    new_address as new_users,
    sum(total_address - new_address) as old_users
    from new_address
    join total_address on total_address.day = first_record
    group by 1, 2


    Run a query to Download Data