AI Waifu2024-05-08 10:46 PM
    Updated 2024-05-08
    with tab1 as (
    select date_trunc('minute',BLOCK_TIMESTAMP) as time
    ,ORIGIN_FROM_ADDRESS
    from base.core.ez_decoded_event_logs
    where ORIGIN_TO_ADDRESS='0xbaF673a8475F8242e666903ce1BDf1882A796B06'
    and BLOCK_TIMESTAMP::date>='2024-04-01'
    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
    ,case
    when time_row=1 then 'Fist Time Swappers' else 'Active Swappers' end as user_type
    ,count(distinct ORIGIN_FROM_ADDRESS) as swappers
    --,sum(new_bridgers) over (order by day) as total_new_bridgers
    from tab2
    --where time_row=1
    group by 1,2
    order by 1,2
    QueryRunArchived: QueryRun has been archived