Madinew wallets
    Updated 2023-01-19
    WITH joindate_optimism as (
    SELECT
    FROM_ADDRESS,
    min(date_trunc('day',BLOCK_TIMESTAMP)) as date
    from optimism.core.fact_transactions where STATUS = 'SUCCESS'
    GROUP BY 1
    ),

    joindate_arbitrum as (
    SELECT
    FROM_ADDRESS,
    min(date_trunc('day',BLOCK_TIMESTAMP)) as date
    from arbitrum.core.fact_transactions where STATUS = 'SUCCESS'
    GROUP BY 1)

    SELECT
    'Optimism' as chain,
    date,
    COUNT(FROM_ADDRESS) as new_wallets,
    sum(new_wallets) over (order by date) as cum_wallets
    FROM
    joindate_optimism
    WHERE date >= '2022-06-17' and date != CURRENT_DATE
    group by 1,2

    UNION ALL

    SELECT
    'Arbitrum' as chain,
    date,
    COUNT(FROM_ADDRESS) as new_wallets,
    sum(new_wallets) over (order by date) as cum_wallets
    FROM
    joindate_arbitrum
    WHERE date >= '2022-06-17' and date != CURRENT_DATE
    Run a query to Download Data