0-MIDD&T New Users base-sol
    Updated 2024-04-27

    with tab1 as (
    select
    TX_HASH
    from base.core.ez_decoded_event_logs
    where EVENT_NAME='LiFiTransferStarted'
    and DECODED_LOG:bridgeData:integrator='jumper.exchange'
    and ORIGIN_TO_ADDRESS='0x1231deb6f5749ef6ce6943a275a1d3e7486f4eae'
    and BLOCK_TIMESTAMP::date>=current_date-30
    and DECODED_LOG:bridgeData:destinationChainId=1151111081099710
    ),
    tab2 as (
    select date_trunc('minute',BLOCK_TIMESTAMP) as time
    ,ORIGIN_FROM_ADDRESS
    from base.core.ez_token_transfers
    where ORIGIN_TO_ADDRESS='0x1231deb6f5749ef6ce6943a275a1d3e7486f4eae'
    and ORIGIN_FROM_ADDRESS=FROM_ADDRESS
    and TX_HASH in (select TX_HASH from tab1)
    and BLOCK_TIMESTAMP::date>=current_date-30
    ),
    tab3 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 tab2
    )
    select day
    ,count(ORIGIN_FROM_ADDRESS) as new_bridgers
    ,sum(new_bridgers)over(order by day) as total_new_bridgers
    from tab3
    where time_row=1
    group by 1


    QueryRunArchived: QueryRun has been archived