h4wkOptimism New Users - Before After
    Updated 2023-10-22
    -- forked from Optimism New Users - Total @ https://flipsidecrypto.xyz/edit/queries/24c2d131-b566-442f-b935-2ac0cfe7f539

    with base as (
    select date_trunc('week', block_timestamp) as date,
    tx_hash,
    from_address as user
    from optimism.core.fact_transactions
    where block_timestamp >= '2022-01-01'
    and status = 'SUCCESS'
    )

    , new_users as (
    select user,
    min(date) as min_date
    from base
    group by 1
    )
    , daily_new_users as (
    select min_date,
    count(user) as new_count
    from new_users
    group by 1
    )

    , all_users as (
    select date, count(distinct user) as all_count
    from base
    group by 1
    )

    -- select * from all_users
    , base_period as (
    select date,
    -- case when date < '2022-06-01' then 'Before 1st Airdrop'
    Run a query to Download Data