Afonso_Diaz2023-08-21 04:15 PM
    Updated 2023-08-21
    with

    t1 as (
    select
    tx_hash,
    block_timestamp,
    origin_from_address as user,
    'Ethereum' as chain,
    case
    when amount_in_usd is not null then amount_in_usd
    when amount_out_usd is not null then amount_out_usd
    else null
    end as amount_usd
    from ethereum.core.ez_dex_swaps
    where platform ilike 'uniswap%'
    and amount_usd is not null

    union all

    select
    tx_hash,
    block_timestamp,
    origin_from_address as user,
    'Avalanche' as chain,
    case
    when amount_in_usd is not null then amount_in_usd
    when amount_out_usd is not null then amount_out_usd
    else null
    end as amount_usd
    from avalanche.core.ez_dex_swaps
    where platform ilike 'uniswap%'
    and amount_usd is not null

    union all

    select
    Run a query to Download Data