0-MIDintimate-coffee
    Updated 2024-10-20

    with tab1 as (
    select DECODED_LOG:bridgeData:bridge as protocol
    ,TX_HASH
    from arbitrum.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
    ),
    tab2 as (
    select
    SOURCE_ADDRESS
    from near.defi.ez_bridge_activity
    ),
    tab3 as (
    select
    AMOUNT_USD
    ,TX_HASH
    from arbitrum.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 ORIGIN_FROM_ADDRESS in (select SOURCE_ADDRESS from tab2)
    )
    select protocol
    ,sum(AMOUNT_USD) as volume
    from tab1
    left join tab3
    on tab1.TX_HASH=tab3.TX_HASH
    group by 1
    order by 2 desc
    limit 10


    QueryRunArchived: QueryRun has been archived