0-MIDmeme base swap swaps
    Updated 2025-01-08

    with tab1 as (
    select
    TX_HASH
    ,ORIGIN_FROM_ADDRESS
    from base.core.ez_decoded_event_logs
    where ORIGIN_TO_ADDRESS='0x1231deb6f5749ef6ce6943a275a1d3e7486f4eae'
    and EVENT_NAME='LiFiGenericSwapCompleted'
    and DECODED_LOG:integrator='jumper.exchange'
    and TX_STATUS='SUCCESS'
    ),
    tab2 as (
    select
    AMOUNT_USD
    ,TX_HASH
    ,ORIGIN_FROM_ADDRESS
    ,TO_ADDRESS
    ,SYMBOL
    from base.core.ez_token_transfers
    where ORIGIN_TO_ADDRESS='0x1231deb6f5749ef6ce6943a275a1d3e7486f4eae'
    and ORIGIN_FROM_ADDRESS=TO_ADDRESS
    and SYMBOL in('KEYCAT','BRETT','DEGEN','TOSHI','MIGGLES','LUM','Mog')
    )
    select SYMBOL
    ,sum(AMOUNT_USD) as volume
    ,count(distinct tab1.ORIGIN_FROM_ADDRESS) as swappers
    ,count(distinct tab1.TX_HASH) as swaps
    from tab1
    left join tab2
    on tab1.TX_HASH=tab2.TX_HASH
    and tab1.ORIGIN_FROM_ADDRESS=tab2.ORIGIN_FROM_ADDRESS
    and AMOUNT_USD is not null
    where SYMBOL is not null
    group by 1
    order by 4 desc

    QueryRunArchived: QueryRun has been archived