0-MIDswap from dis
    with act1 as (
    with tab1 as (
    select ADDRESS
    ,PROJECT_NAME
    from arbitrum.core.dim_labels
    where LABEL_TYPE='dex')
    ,tab2 as (
    select
    AMOUNT
    ,FROM_ADDRESS
    ,ORIGIN_FROM_ADDRESS
    ,ORIGIN_TO_ADDRESS
    ,TO_ADDRESS
    ,TX_HASH
    from arbitrum.core.ez_token_transfers
    where CONTRACT_ADDRESS in (lower('0xaf88d065e77c8cC2239327C5EDb3A432268e5831'),lower('0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8'))
    )
    select
    'ARBITRUM' as chain
    ,case
    when AMOUNT>0 and AMOUNT<10 then 'Below 10 $'
    when AMOUNT>=10 and AMOUNT<100 then '10~100 $'
    when AMOUNT>=100 and AMOUNT<1000 then '100~1K $'
    when AMOUNT>=1000 and AMOUNT<10000 then '1K~10K $'
    when AMOUNT>=10000 then 'Up To 10K $' end as dis_volume
    ,count(distinct ORIGIN_FROM_ADDRESS) as swappers_from
    ,count(distinct TX_HASH ) as swaps_from
    from tab1
    left join tab2
    on tab1.ADDRESS=tab2.ORIGIN_TO_ADDRESS
    where ORIGIN_FROM_ADDRESS=FROM_ADDRESS
    and dis_volume is not null
    group by 1,2),
    -------------------------------
    act2 as (
    with tab1 as (
    Run a query to Download Data