Yousefi_1994Optimistic Sushi - Arbitrum daily new user
    Updated 2023-04-06
    ----------------------------------- Arbitrum -----------------------------------

    with arbitrum_new_user as (
    select
    origin_from_address as from_address,
    min(block_timestamp) as min_block_timestamp
    from arbitrum.core.fact_event_logs
    where origin_from_address != '0x0000000000000000000000000000000000000000'
    and tx_status = 'SUCCESS'
    group by from_address
    having min_block_timestamp >= '2022-06-01'
    ),
    arbitrum_count_new_user as (
    select
    min_block_timestamp::date as "Days",
    count(distinct from_address) as "Number of New User"
    from arbitrum_new_user
    group by "Days"
    ),
    arbitrum_user_transactions as (
    select
    tx_hash,
    origin_from_address as from_address,
    min(block_timestamp) as min_block_timestamp
    from arbitrum.core.fact_event_logs
    where origin_from_address != '0x0000000000000000000000000000000000000000'
    and origin_from_address in (select from_address from arbitrum_new_user)
    and tx_status = 'SUCCESS'
    group by tx_hash, from_address
    ),
    arbitrum_user_transactions_and_rank as (
    select
    *,
    row_number() over(partition by from_address order by min_block_timestamp) as row_num
    from arbitrum_user_transactions
    ),
    Run a query to Download Data