Afonso_DiazSwappers retention rate
    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)
    ),
    first_swaps as (
    select swapper, min(block_timestamp) as first_swap_date
    from main
    group by swapper
    ),
    retention as (
    select
    date_trunc('{{ period }}', m.block_timestamp) as day,
    count(distinct m.swapper) as active_swappers, -- Unique swappers per day
    count(distinct case when f.first_swap_date = m.block_timestamp then m.swapper end) as new_swappers,
    count(distinct case when f.first_swap_date < m.block_timestamp then m.swapper end) as returning_swappers
    from main m
    left join first_swaps f on m.swapper = f.swapper
    group by day
    )
    select
    Last run: 19 days ago
    DAY
    ACTIVE_SWAPPERS
    NEW_SWAPPERS
    RETURNING_SWAPPERS
    RETENTION_RATE
    1
    2022-07-01 00:00:00.000157615764240.269035533
    2
    2022-08-01 00:00:00.000124791178240150.3217405241
    3
    2022-09-01 00:00:00.00010503766946770.4453013425
    4
    2022-10-01 00:00:00.0005937379129310.4936836786
    5
    2022-11-01 00:00:00.000152681173965640.4299187844
    6
    2022-12-01 00:00:00.0007144438335780.5008398656
    7
    2023-01-01 00:00:00.000158891212361790.3888853924
    8
    2023-02-01 00:00:00.0005557322928240.5081878712
    9
    2023-03-01 00:00:00.0006844427535900.5245470485
    10
    2023-04-01 00:00:00.0007197444538650.5370293178
    11
    2023-05-01 00:00:00.0006879423337400.543683675
    12
    2023-06-01 00:00:00.0006233357736610.5873576127
    13
    2023-07-01 00:00:00.0008448561340400.478219697
    14
    2023-08-01 00:00:00.0006312362235440.5614702155
    15
    2023-09-01 00:00:00.0004687232229020.619159377
    16
    2023-10-01 00:00:00.0007290394444410.6091906722
    17
    2023-11-01 00:00:00.0002122914953119550.5631447548
    18
    2023-12-01 00:00:00.0006404951878367290.5734515761
    19
    2024-01-01 00:00:00.0004907231471311810.6354132703
    20
    2024-02-01 00:00:00.0004855632825305390.6289438998
    34
    2KB
    2s