Afonso_DiazSwapper Behavior Segmentation
    Updated 2025-04-24
    with main as (
    select
    tx_id,
    block_timestamp,
    swapper,
    swap_from_symbol as symbol_in,
    swap_to_symbol as symbol_out,
    abs(nvl(swap_from_amount_usd, swap_to_amount_usd)) as amount_usd,
    case
    when platform ilike 'jupiter%' then 'Jupiter'
    when platform ilike 'raydium%' then 'Raydium'
    when platform ilike 'meteora%' then 'Meteora'
    when platform ilike 'saber%' then 'Saber'
    when platform ilike 'orca%' then 'Orca'
    else initcap(platform)
    end as platform
    from solana.marinade.ez_swaps
    where succeeded
    and 'MSOL' in (symbol_in, symbol_out)
    ),
    swapper_activity as (
    select
    swapper,
    count(*) as total_swaps,
    sum(amount_usd) as total_volume_usd,
    min(block_timestamp) as first_swap_date,
    max(block_timestamp) as last_swap_date
    from main
    group by swapper
    ),
    segmentation as (
    select
    swapper,
    total_swaps,
    total_volume_usd,
    case
    Last run: 17 days ago
    SWAPPER_CATEGORY
    NUM_SWAPPERS
    1
    Casual Swapper228546
    2
    One-time Swapper225457
    3
    Frequent Small Swapper57418
    4
    High-Value Swapper13951
    4
    117B
    1s