0-MIDdaily new users arb
    Updated 2024-04-08

    with tab1 as (
    select date_trunc('minute',BLOCK_TIMESTAMP) as time
    ,ORIGIN_FROM_ADDRESS
    from arbitrum.core.ez_decoded_event_logs
    where ORIGIN_TO_ADDRESS='0x1231deb6f5749ef6ce6943a275a1d3e7486f4eae'
    and EVENT_NAME='LiFiGenericSwapCompleted'
    and BLOCK_TIMESTAMP::date>=current_date-30
    and TX_STATUS='SUCCESS'
    ),
    tab2 as (
    select date_trunc('day',time) as day
    ,ORIGIN_FROM_ADDRESS
    ,row_number()over(partition by ORIGIN_FROM_ADDRESS order by day) as time_row
    from tab1
    )
    select day
    ,count(ORIGIN_FROM_ADDRESS) as new_swappers
    from tab2
    where time_row=1
    group by 1