Trader JoeOverall DEX Volume
    Updated 2024-08-13
    with

    dexes as (
    select
    block_timestamp,
    tx_hash,
    amount_out,
    amount_in,
    symbol_out,
    symbol_in,
    token_out,
    token_in,
    amount_out_usd,
    amount_in_usd,
    contract_address,
    -- left(pool_name,9) as pool_name,
    case when symbol_in='WETH' and token_out='0xff970a61a04b1ca14834a43f5de4533ebddb5cc8' then concat(symbol_in,'-USDC.e')
    when symbol_in='WETH' and token_out!='0xff970a61a04b1ca14834a43f5de4533ebddb5cc8' then concat(symbol_in,'-',symbol_out)
    when symbol_out='WETH' and token_in='0xff970a61a04b1ca14834a43f5de4533ebddb5cc8' then concat(symbol_out,'-USDC.e')
    when symbol_out='WETH' and token_in!='0xff970a61a04b1ca14834a43f5de4533ebddb5cc8' then concat(symbol_out,'-',symbol_in)
    end as pool_name,
    platform
    from
    arbitrum.defi.ez_dex_swaps
    WHERE
    1=1
    and event_name='Swap'
    and platform in (
    'trader-joe-v2',
    --'trader-joe-v1',
    'uniswap-v3',
    --'camelot-v2',
    'camelot-v3',
    'sushiswap'
    )
    and (
    QueryRunArchived: QueryRun has been archived