Pine Analyticsslow-coral copy copy copy
    Updated 2025-03-08
    select
    case when swap_volume_usd < 10 then 'a/ Below 10'
    when swap_volume_usd < 100 then 'b/ 10-100'
    when swap_volume_usd < 1000 then 'c/ 100-1K'
    when swap_volume_usd < 10000 then 'd/ 1K-10K'
    when swap_volume_usd < 100000 then 'e/ 10K-100K'
    when swap_volume_usd < 1000000 then 'f/ 100K-1M'
    when swap_volume_usd < 10000000 then 'g/ 1M-10M'
    else 'h/ 10M+' end as swap_volume_group,
    count(*) as swappers,
    sum(swap_volume_Usd) as total_swap_volume

    from (
    select
    from_address,
    count(Distinct tx_id) as transactions,
    sum(case when not FROM_AMOUNT_USD is null then FROM_AMOUNT_USD else to_AMOUNT_USD end) as swap_volume_Usd


    from maya.defi.fact_swaps
    where block_timestamp > current_date - 30
    group by 1
    order by 3 desc
    )
    group by 1



    Last run: 11 days ago
    SWAP_VOLUME_GROUP
    SWAPPERS
    TOTAL_SWAP_VOLUME
    1
    h/ 10M+226313710.346972
    2
    d/ 1K-10K5432015487.55350458
    3
    a/ Below 10114473.252555357
    4
    c/ 100-1K458182019.198299401
    5
    f/ 100K-1M14552846432.9809296
    6
    b/ 10-10034314151.93466731
    7
    e/ 10K-100K34011462611.9959326
    8
    g/ 1M-10M28113984186.480365
    8
    275B
    2s