Afonso_DiazGrouping swaps
    Updated 2025-05-10
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    swapper,
    symbol_in,
    symbol_out,
    token_in,
    token_out,
    iff(amount_in_usd < 1e7, amount_in_usd, amount_out_usd) as amount_usd
    from
    aptos.defi.ez_dex_swaps
    where
    amount_usd < 1e7
    and platform = 'pancake'
    )

    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 swaps
    from
    main
    group by 1
    order by 1
    Last run: 12 days ago
    TYPE
    SWAPS
    1
    $10 - $501456219
    2
    $10,000 - $100,0002327
    3
    $100 - $5001560977
    4
    $1000 - $5000256811
    5
    $50 - $100647967
    6
    $500 - $1000460003
    7
    $5000 - $10,0007782
    8
    Less than $108838499
    9
    More than $100,0007
    9
    222B
    3s