Afonso_DiazBy Platform
    Updated 2025-03-22
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    origin_from_address as swapper,
    nvl(amount_in_usd, amount_out_usd) as amount_usd,
    iff(token_in = '0xc891eb4cbdeff6e073e859e987815ed1505c2acd', amount_in, amount_out) as amount_euro,
    regexp_replace(platform, '-v.*', '') as platform
    from
    avalanche.defi.ez_dex_swaps
    where
    '0xc891eb4cbdeff6e073e859e987815ed1505c2acd' in (token_in, token_out)
    )

    select
    platform,
    count(distinct tx_hash) as swaps,
    count(distinct swapper) as swappers,
    sum(amount_euro) as volume_euro,
    avg(amount_euro) as average_amount_euro,
    sum(amount_usd) as volume_usd,
    avg(amount_usd) as average_amount_usd
    from
    main
    group by 1

    QueryRunArchived: QueryRun has been archived