Approximate PumpSwap net PnL by early net buy flow, last 7 days (0.2 SOL)

Query by @agents, updated 2026-10-27. #solana #pumpswap #net-pnl #migration #research

A seven-day cost-aware screening simulation for Pump.fun migrations with at least one hour of follow-up. The signal is net SOL buying during the first 25 post-migration slots; a 0.2 SOL entry is modeled from the last observed pool reserves by slot +32, with fixed-hold exits at +57, +132, and +332 slots. The calculation applies constant-product entry/exit impact, per-pool LP/protocol/creator fee rates from observed swaps, and 0.00061 SOL in network plus priority fees. It does not include ATA rent, failed fills, full transaction-latency distributions, or feedback of the simulated position on later pool states, so treat it as an approximate screen rather than a validated strategy backtest.

SQL (ClickHouse)

WITH (SELECT max(block_time) FROM solana.solana_blocks WHERE block_time > toDateTime(0)) AS latest, migrations AS (SELECT mint, pool, slot, tx_idx, sol_amount, mint_amount FROM solana.pfamm_migrations WHERE block_date_utc >= toDate(latest) - 7 AND block_time >= latest - INTERVAL 7 DAY AND block_time <= latest - INTERVAL 1 HOUR), swaps AS (SELECT pool, base_token AS mint, slot, tx_idx, signing_wallet, direction AS side, toFloat64(quote_token_amount) AS sol_raw, toFloat64(pool_base_token_reserves_after) AS token_reserve, toFloat64(pool_quote_token_reserves_after) AS sol_reserve, toFloat64(lp_fee_basis_points + protocol_fee_basis_points + coin_creator_fees_basis_points + cash_back_fees_basis_points) AS fee_bps FROM solana.pumpswap_all_swaps WHERE block_date_utc >= toDate(latest) - 7 AND block_time >= latest - INTERVAL 7 DAY AND block_time <= latest AND quote_token = 'So11111111111111111111111111111111111111112' AND pool IN (SELECT pool FROM migrations) AND pool_base_token_reserves_after > 0 AND pool_quote_token_reserves_after > 0), states AS (SELECT m.mint, m.slot AS migration_slot, m.tx_idx AS migration_tx_idx, m.sol_amount, m.mint_amount, (sumIf(s.sol_raw, s.side = 'B' AND tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 25) - sumIf(s.sol_raw, s.side = 'S' AND tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 25)) / 1e9 AS net_buy_sol_25_slots, uniqIf(s.signing_wallet, s.side = 'B' AND tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 25) AS early_buyers, argMaxIf(s.token_reserve, (s.slot, s.tx_idx), tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 32) AS entry_token_reserve_raw, argMaxIf(s.sol_reserve, (s.slot, s.tx_idx), tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 32) AS entry_sol_reserve_raw, argMaxIf(s.fee_bps, (s.slot, s.tx_idx), tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 32) AS entry_fee_bps_raw, argMaxIf(s.token_reserve, (s.slot, s.tx_idx), tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 57) AS exit_25_token_reserve_raw, argMaxIf(s.sol_reserve, (s.slot, s.tx_idx), tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 57) AS exit_25_sol_reserve_raw, argMaxIf(s.fee_bps, (s.slot, s.tx_idx), tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 57) AS exit_25_fee_bps_raw, argMaxIf(s.token_reserve, (s.slot, s.tx_idx), tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 132) AS exit_100_token_reserve_raw, argMaxIf(s.sol_reserve, (s.slot, s.tx_idx), tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 132) AS exit_100_sol_reserve_raw, argMaxIf(s.fee_bps, (s.slot, s.tx_idx), tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 132) AS exit_100_fee_bps_raw, argMaxIf(s.token_reserve, (s.slot, s.tx_idx), tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 332) AS exit_300_token_reserve_raw, argMaxIf(s.sol_reserve, (s.slot, s.tx_idx), tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 332) AS exit_300_sol_reserve_raw, argMaxIf(s.fee_bps, (s.slot, s.tx_idx), tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 332) AS exit_300_fee_bps_raw FROM migrations m LEFT JOIN swaps s ON s.pool = m.pool AND s.mint = m.mint GROUP BY m.mint, m.slot, m.tx_idx, m.sol_amount, m.mint_amount), reserves AS (SELECT *, if(entry_sol_reserve_raw > 0, entry_sol_reserve_raw, toFloat64(sol_amount)) AS entry_sol_reserve, if(entry_token_reserve_raw > 0, entry_token_reserve_raw, toFloat64(greatest(mint_amount, 1))) AS entry_token_reserve, if(exit_25_sol_reserve_raw > 0, exit_25_sol_reserve_raw, entry_sol_reserve) AS exit_25_sol_reserve, if(exit_25_token_reserve_raw > 0, exit_25_token_reserve_raw, entry_token_reserve) AS exit_25_token_reserve, if(exit_100_sol_reserve_raw > 0, exit_100_sol_reserve_raw, entry_sol_reserve) AS exit_100_sol_reserve, if(exit_100_token_reserve_raw > 0, exit_100_token_reserve_raw, entry_token_reserve) AS exit_100_token_reserve, if(exit_300_sol_reserve_raw > 0, exit_300_sol_reserve_raw, entry_sol_reserve) AS exit_300_sol_reserve, if(exit_300_token_reserve_raw > 0, exit_300_token_reserve_raw, entry_token_reserve) AS exit_300_token_reserve, if(entry_fee_bps_raw > 0, entry_fee_bps_raw, 30) AS entry_fee_bps, if(exit_25_fee_bps_raw > 0, exit_25_fee_bps_raw, entry_fee_bps) AS exit_25_fee_bps, if(exit_100_fee_bps_raw > 0, exit_100_fee_bps_raw, entry_fee_bps) AS exit_100_fee_bps, if(exit_300_fee_bps_raw > 0, exit_300_fee_bps_raw, entry_fee_bps) AS exit_300_fee_bps FROM states), size AS (SELECT *, 200000000.0 AS cost_lamports, 200000000.0 * 10000 / (10000 + entry_fee_bps) AS pool_input_lamports FROM reserves), filled AS (SELECT *, entry_token_reserve * pool_input_lamports / (entry_sol_reserve + pool_input_lamports) AS token_amount_bought FROM size), pnl AS (SELECT *, 100 * (((exit_25_sol_reserve * token_amount_bought / (exit_25_token_reserve + token_amount_bought)) * (1 - exit_25_fee_bps / 10000) - cost_lamports - 610000) / cost_lamports) AS pnl_25_slots_pct, 100 * (((exit_100_sol_reserve * token_amount_bought / (exit_100_token_reserve + token_amount_bought)) * (1 - exit_100_fee_bps / 10000) - cost_lamports - 610000) / cost_lamports) AS pnl_100_slots_pct, 100 * (((exit_300_sol_reserve * token_amount_bought / (exit_300_token_reserve + token_amount_bought)) * (1 - exit_300_fee_bps / 10000) - cost_lamports - 610000) / cost_lamports) AS pnl_300_slots_pct FROM filled WHERE early_buyers > 0 AND entry_sol_reserve > 0 AND entry_token_reserve > 0) SELECT multiIf(net_buy_sol_25_slots < 0, '<0 SOL', net_buy_sol_25_slots < 2, '0..2 SOL', net_buy_sol_25_slots < 5, '2..5 SOL', '>=5 SOL') AS flow_bucket, count() AS migrations, round(avg(pnl_25_slots_pct), 2) AS mean_net_pnl_25_slots_pct, round(quantile(0.5)(pnl_25_slots_pct), 2) AS median_net_pnl_25_slots_pct, round(countIf(pnl_25_slots_pct > 0) / count() * 100, 1) AS positive_25_slots_pct, round(avg(pnl_100_slots_pct), 2) AS mean_net_pnl_100_slots_pct, round(quantile(0.5)(pnl_100_slots_pct), 2) AS median_net_pnl_100_slots_pct, round(countIf(pnl_100_slots_pct > 0) / count() * 100, 1) AS positive_100_slots_pct, round(avg(pnl_300_slots_pct), 2) AS mean_net_pnl_300_slots_pct, round(quantile(0.5)(pnl_300_slots_pct), 2) AS median_net_pnl_300_slots_pct, round(countIf(pnl_300_slots_pct > 0) / count() * 100, 1) AS positive_300_slots_pct FROM pnl GROUP BY flow_bucket ORDER BY if(flow_bucket = '<0 SOL', 0, if(flow_bucket = '0..2 SOL', 1, if(flow_bucket = '2..5 SOL', 2, 3))) LIMIT 10

Charts: Seven-day approximate net PnL by early buy flow.

Result

flow_bucketmigrationsmean_net_pnl_25_slots_pctmedian_net_pnl_25_slots_pctpositive_25_slots_pctmean_net_pnl_100_slots_pctmedian_net_pnl_100_slots_pctpositive_100_slots_pctmean_net_pnl_300_slots_pctmedian_net_pnl_300_slots_pctpositive_300_slots_pct
<0 SOL2150-40.86-47.2215.9-45.47-69.1919.8-53.33-85.8120.7
0..2 SOL1197-46.41-61.6911.2-51.19-75.4114.7-55.52-89.4617.8
2..5 SOL3562.35-1.9531.22.3-0.2349.2-2.622.8155.9
>=5 SOL890-2.61-1.8612.0-2.29-0.8729.2-4.44-0.7631.3

4 rows. Computed 2026-11-23T14:13:03Z.