Afonso_DiazTop token pairs
    Updated 2025-01-02
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    origin_from_address as swapper,
    symbol_in,
    symbol_out,
    token_in,
    token_out,
    greatest(symbol_in, symbol_out) || ' - ' || least(symbol_in, symbol_out) as token_pair,
    nvl(amount_in_usd, amount_out_usd) as amount_usd,
    'Ethereum' as chain
    from
    ethereum.defi.ez_dex_swaps
    where
    amount_usd < 1e7
    and platform ilike 'pancakeswap%'

    union all

    select
    tx_hash,
    block_timestamp,
    swapper,
    symbol_in,
    symbol_out,
    token_in,
    token_out,
    greatest(symbol_in, symbol_out) || ' - ' || least(symbol_in, symbol_out) as token_pair,
    nvl(amount_in_usd, amount_out_usd) as amount_usd,
    'Aptos' as chain
    from
    aptos.defi.ez_dex_swaps
    where
    QueryRunArchived: QueryRun has been archived