Afonso_DiazBy Platform & Type
    Updated 2025-05-18
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    coalesce(amount_in_usd, amount_out_usd) as amount_usd,
    origin_from_address as swapper,
    symbol_in,
    symbol_out,
    token_in,
    token_out,
    replace(replace(replace(platform, '-v1', ''), '-v2', ''), '-v3', '') as platform_name,
    symbol_in || ' -> ' || symbol_out as token_pair,
    iff(symbol_in = 'BLUB', 'Sell', 'Buy') as swap_type
    from
    avalanche.defi.ez_dex_swaps
    where
    '0x0f669808d88b2b0b3d23214dcd2a1cc6a8b1b5cd' in (token_in, token_out)
    )

    select
    platform_name,
    swap_type,
    count(distinct tx_hash) as swaps,
    count(distinct swapper) as swappers,
    sum(amount_usd) as volume_usd,
    avg(amount_usd) as average_amount_usd
    from
    main
    group by 1, 2
    order by 1, 2


    Last run: 27 days ago
    PLATFORM_NAME
    SWAP_TYPE
    SWAPS
    SWAPPERS
    VOLUME_USD
    AVERAGE_AMOUNT_USD
    1
    pangolinBuy375951100.2933333333
    2
    pangolinSell454105139.060.3062995595
    3
    pharaohBuy1126522315122103.29438.423631773
    4
    pharaohSell1268419665027637.47385.910152748
    5
    trader-joeBuy684971920551289039.74694.644
    6
    trader-joeSell658401768653332020.9745.558286385
    7
    uniswapBuy77129.9818.568571429
    8
    uniswapSell5397.9919.598
    8
    391B
    2s