Afonso_DiazGrouping swappers
    Updated 4 days ago
    with ton_prices as (
    select
    hour::date as date,
    avg(price) as ton_price
    from
    crosschain.price.ez_prices_hourly
    where
    token_address = '0x76a797a59ba2c17726896976b7b3747bfd1d220f'
    and blockchain = 'bsc'
    group by 1
    ),

    latest_metadata as (
    select
    address,
    symbol,
    row_number() over (partition by address order by update_timestamp_onchain desc nulls last) as rn
    from ton.core.fact_jetton_metadata
    ),

    main as (
    select
    tx_hash,
    block_timestamp,
    trader_address as swapper,
    case
    when volume_usd is not null then volume_usd
    when volume_ton is not null then volume_ton * tp.ton_price
    else null
    end as amount_usd,
    token_bought_address,
    token_sold_address,
    jm_bought.symbol as bought_symbol,
    jm_sold.symbol as sold_symbol,
    project,
    pool_address,
    Last run: 4 days ago
    CATEGORY
    RANGE
    NUM_SWAPPERS
    1
    one-time (1 swap)1 swap2729090
    2
    occasional (2–5 swaps)2–5 swaps2044372
    3
    frequent (6–20 swaps)6–20 swaps468042
    4
    power (21+ swaps)21+ swaps138958
    4
    182B
    20s