kingharald-ethNew Optimism users in the last month
    Updated 2022-09-03
    with list as (
    select distinct(from_address) as wallet_address from optimism.core.fact_transactions
    where status = 'SUCCESS'
    and block_timestamp < current_date - interval '1 month'
    UNION

    select distinct(to_address) as wallet_address from optimism.core.fact_transactions
    where status = 'SUCCESS'
    and block_timestamp < current_date - interval '1 month'
    ),

    list2 as (
    select distinct(from_address) as wallet_address from optimism.core.fact_transactions
    where status = 'SUCCESS'
    and block_timestamp >= current_date - interval '1 month'
    and not exists(select * from list where from_address = list.wallet_address)
    ),

    list3 as (
    select distinct(to_address) as wallet_address from optimism.core.fact_transactions
    where status = 'SUCCESS'
    and block_timestamp >= current_date - interval '1 month'
    and not exists(select * from list where to_address = list.wallet_address)
    and not exists(select * from list2 where to_address = list2.wallet_address)
    )

    select count(*) as wallets_count from list2
    Run a query to Download Data