AMLBotnew users in breakdown by blockchain copy
    Updated 2023-11-14
    with optimism_users_first_activity as(
    select
    wallet,
    'Optimism' blockchain,
    min(week) first_activity_week
    from
    (
    (select
    date_trunc(week,block_timestamp) as week,
    'Optimism' blockchain,
    'Inflow to L0' type,
    tx_hash,
    from_address wallet
    from optimism.core.ez_token_transfers
    where
    (to_address in (select address from
    Optimism.core.dim_labels
    where ADDRESS_NAME ilike '%layerzero%')
    --and date_trunc(week,block_timestamp) >= current_date - {{days_back}}
    )
    )
    union all
    (select
    date_trunc(week,block_timestamp) week,
    'Optimism' blockchain,
    'Inflow to L0' type,
    tx_hash,
    ETH_from_address wallet
    from Optimism.core.ez_eth_transfers
    where
    (
    ETH_to_address in (select address from
    Optimism.core.dim_labels
    Run a query to Download Data