Afonso_DiazGrouping transactions
    Updated 2025-06-04
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    origin_from_address as swapper,
    platform,
    symbol_in,
    symbol_out,
    iff(amount_in_usd > 1e7, amount_out_usd, amount_in_usd) as amount_usd,
    from avalanche.defi.ez_dex_swaps
    where amount_usd between 0 and 1e7
    and block_timestamp between '{{ start_date }}' and '{{ end_date }}'
    )

    select
    case
    when amount_usd < 10 then 'Less than $10'
    when amount_usd <= 50 then '$10 - $50'
    when amount_usd <= 100 then '$50 - $100'
    when amount_usd <= 500 then '$100 - $500'
    when amount_usd <= 1000 then '$500 - $1000'
    when amount_usd <= 5000 then '$1000 - $5000'
    when amount_usd <= 10000 then '$5000 - $10,000'
    when amount_usd <= 100000 then '$10,000 - $100,000'
    else 'More than $100,000'
    end as type,
    count(distinct tx_hash) as transactions
    from main
    group by 1
    order by 1


    Last run: 13 days ago
    TYPE
    TRANSACTIONS
    1
    $10 - $504814297
    2
    $10,000 - $100,000866457
    3
    $100 - $5006673953
    4
    $1000 - $50005944735
    5
    $50 - $1002803102
    6
    $500 - $10003082364
    7
    $5000 - $10,000990073
    8
    Less than $105804391
    9
    More than $100,00043154
    9
    233B
    3s