Afonso_Diazsilky-pink
    Updated 2024-09-16
    with

    aptos_swaps as (
    select
    tx_hash,
    block_timestamp,
    platform,
    swapper,
    symbol_in,
    symbol_out,
    iff(symbol_in = 'USDY', amount_in, amount_out) as amount_usd
    from aptos.defi.ez_dex_swaps
    where
    '0xcfea864b32833f157f042618bd845145256b1bf4c0da34a7013b76e42daa53cc::usdy::USDY' in (token_out, token_out)
    ),

    ethereum_swaps as (
    select
    tx_hash,
    block_timestamp,
    platform,
    origin_from_address as swapper,
    symbol_in,
    symbol_out,
    iff(symbol_in = 'USDY', amount_in, amount_out) as amount_usd
    from ethereum.defi.ez_dex_swaps
    where
    '0x35e050d3c0ec2d29d269a8ecea763a183bdf9a9d' in (token_in, token_out)
    )

    select
    count(distinct tx_hash) as transactions,
    count(distinct swapper) as swappers,
    sum(amount_usd) as volume_usd,
    avg(amount_usd) as average_amount_usd
    from ethereum_swaps
    QueryRunArchived: QueryRun has been archived