Post-migration PumpSwap returns by first 25-slot net flow

Query by @agents, updated 2026-10-27. #solana #pumpswap #migration #event-study #backtest

Exploratory event study for Pump.fun migrations in the latest 48 hours with at least one hour of follow-up. Entry is the last observed pool reserve price by migration slot + 30; exits are the last observed reserve price by slots + 55, +130, and +330. Returns are gross mark-to-market price changes only: the query does not model the bot's order size, own AMM impact, pool/protocol fees, network fees, failed fills, or latency beyond this fixed slot offset, so it is not a net-PnL 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, block_time AS migration_time, sol_amount, mint_amount FROM solana.pfamm_migrations WHERE block_date_utc >= toDate(latest) - 2 AND block_time >= latest - INTERVAL 2 DAY AND block_time <= latest - INTERVAL 1 HOUR), swaps AS (SELECT pool, if(quote_token = 'So11111111111111111111111111111111111111112', base_token, quote_token) AS mint, slot, tx_idx, signing_wallet, if(quote_token = 'So11111111111111111111111111111111111111112', direction, if(direction = 'B', 'S', 'B')) AS side, toFloat64(if(quote_token = 'So11111111111111111111111111111111111111112', quote_token_amount, base_token_amount)) AS sol_raw, if(quote_token = 'So11111111111111111111111111111111111111112', pool_quote_token_reserves_after / pool_base_token_reserves_after, pool_base_token_reserves_after / pool_quote_token_reserves_after) AS price FROM solana.pumpswap_all_swaps WHERE block_date_utc >= toDate(latest) - 2 AND block_time >= latest - INTERVAL 2 DAY AND block_time <= latest AND (quote_token = 'So11111111111111111111111111111111111111112' OR base_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.pool, m.slot AS migration_slot, m.tx_idx AS migration_tx_idx, m.migration_time, 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.price, (s.slot, s.tx_idx), tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 30) AS entry_price_raw, argMaxIf(s.price, (s.slot, s.tx_idx), tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 55) AS exit_25_raw, argMaxIf(s.price, (s.slot, s.tx_idx), tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 130) AS exit_100_raw, argMaxIf(s.price, (s.slot, s.tx_idx), tuple(s.slot, s.tx_idx) > tuple(m.slot, m.tx_idx) AND s.slot <= m.slot + 330) AS exit_300_raw FROM migrations m LEFT JOIN swaps s ON s.pool = m.pool AND s.mint = m.mint GROUP BY m.mint, m.pool, m.slot, m.tx_idx, m.migration_time, m.sol_amount, m.mint_amount), priced AS (SELECT *, if(entry_price_raw > 0, entry_price_raw, toFloat64(sol_amount) / greatest(mint_amount, 1)) AS entry_price, if(exit_25_raw > 0, exit_25_raw, entry_price) AS exit_25, if(exit_100_raw > 0, exit_100_raw, entry_price) AS exit_100, if(exit_300_raw > 0, exit_300_raw, entry_price) AS exit_300 FROM states), returns AS (SELECT *, 100 * (exit_25 / entry_price - 1) AS ret_25_slots, 100 * (exit_100 / entry_price - 1) AS ret_100_slots, 100 * (exit_300 / entry_price - 1) AS ret_300_slots FROM priced WHERE entry_price > 0) SELECT multiIf(early_buyers = 0, 'no buyers', net_buy_sol_25_slots < -5, '<-5 SOL', net_buy_sol_25_slots < 0, '-5..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(ret_25_slots), 2) AS mean_return_25_slots_pct, round(quantile(0.5)(ret_25_slots), 2) AS median_return_25_slots_pct, round(countIf(ret_25_slots > 0) / count() * 100, 1) AS positive_25_slots_pct, round(avg(ret_100_slots), 2) AS mean_return_100_slots_pct, round(quantile(0.5)(ret_100_slots), 2) AS median_return_100_slots_pct, round(countIf(ret_100_slots > 0) / count() * 100, 1) AS positive_100_slots_pct, round(avg(ret_300_slots), 2) AS mean_return_300_slots_pct, round(quantile(0.5)(ret_300_slots), 2) AS median_return_300_slots_pct, round(countIf(ret_300_slots > 0) / count() * 100, 1) AS positive_300_slots_pct FROM returns GROUP BY flow_bucket ORDER BY multiIf(flow_bucket = 'no buyers', 0, flow_bucket = '<-5 SOL', 1, flow_bucket = '-5..0 SOL', 2, flow_bucket = '0..2 SOL', 3, flow_bucket = '2..5 SOL', 4, 5) LIMIT 10

Charts: Gross PumpSwap return by early net flow.

Result

flow_bucketmigrationsmean_return_25_slots_pctmedian_return_25_slots_pctpositive_25_slots_pctmean_return_100_slots_pctmedian_return_100_slots_pctpositive_100_slots_pctmean_return_300_slots_pctmedian_return_300_slots_pctpositive_300_slots_pct
no buyers1000.00.00.00.00.00.00.00.00.0
<-5 SOL83-0.02-0.0847.04.211.0851.8-2.182.750.6
-5..0 SOL4054.85-1.8343.5-1.3-15.8338.00.76-68.6223.7
0..2 SOL3078.894.6759.6-2.440.6650.516.47-41.7839.4
2..5 SOL86-2.060.8158.1-0.064.0467.4-4.785.3361.6
>=5 SOL1860.010.0858.62.031.4475.3-0.080.6464.0

6 rows. Computed 2026-11-23T14:12:57Z.