Eman-RazAXL Token Swap per DEX
    Updated 2025-03-25
    with final_table as (
    --------------------------------------------------------Arbitrum----------------------------------------------------------------------------

    with arbitrum as (select platform as "DEX", sum(amount_in_usd) as "Swap Volume ($USD)",
    count(distinct origin_from_address) as "Swapper Count", count(distinct tx_hash) as "Swap Count", 'Arbitrum' as "Chain"
    from arbitrum.defi.ez_dex_swaps
    where (token_in=lower('0x23ee2343b892b1bb63503a4fabc840e0e2c6810f') or token_out=lower('0x23ee2343b892b1bb63503a4fabc840e0e2c6810f'))
    and block_timestamp::date>='{{Start_Date}}' and block_timestamp::date<='{{End_Date}}'
    GROUP BY 1
    order by 2 desc),

    -------------------------------------------------BSC-----------------------------------------------------------------------------------
    -- 0x8b1f4432f943c465a973fedc6d7aa50fc96f1f65

    bsc as (select platform as "DEX", sum(amount_in_usd) as "Swap Volume ($USD)",
    count(distinct origin_from_address) as "Swapper Count", count(distinct tx_hash) as "Swap Count", 'BSC' as "Chain"
    from bsc.defi.ez_dex_swaps
    where (token_in=lower('0x8b1f4432f943c465a973fedc6d7aa50fc96f1f65') or token_out=lower('0x8b1f4432f943c465a973fedc6d7aa50fc96f1f65'))
    and block_timestamp::date>='{{Start_Date}}' and block_timestamp::date<='{{End_Date}}' and amount_in_usd is not null
    GROUP BY 1
    order by 2 desc),

    -----------------------------------------------------------Avalanche-------------------------------------------------
    -- 0x44c784266cf024a60e8acf2427b9857ace194c5d

    avalanche as (select platform as "DEX", sum(amount_in_usd) as "Swap Volume ($USD)",
    count(distinct origin_from_address) as "Swapper Count", count(distinct tx_hash) as "Swap Count", 'Avalanche' as "Chain"
    from avalanche.defi.ez_dex_swaps
    where (token_in=lower('0x44c784266cf024a60e8acf2427b9857ace194c5d') or token_out=lower('0x44c784266cf024a60e8acf2427b9857ace194c5d'))
    and block_timestamp::date>='{{Start_Date}}' and block_timestamp::date<='{{End_Date}}' and amount_in_usd is not null
    GROUP BY 1
    order by 2 desc),

    -----------------------------------------------------------Ethereum-------------------------------------------------
    -- 0x467719ad09025fcc6cf6f8311755809d45a5e5f3

    Auto-refreshes every 24 hours
    QueryRunArchived: QueryRun has been archived