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.
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.
| flow_bucket | migrations | mean_return_25_slots_pct | median_return_25_slots_pct | positive_25_slots_pct | mean_return_100_slots_pct | median_return_100_slots_pct | positive_100_slots_pct | mean_return_300_slots_pct | median_return_300_slots_pct | positive_300_slots_pct |
|---|---|---|---|---|---|---|---|---|---|---|
| no buyers | 100 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
| <-5 SOL | 83 | -0.02 | -0.08 | 47.0 | 4.21 | 1.08 | 51.8 | -2.18 | 2.7 | 50.6 |
| -5..0 SOL | 405 | 4.85 | -1.83 | 43.5 | -1.3 | -15.83 | 38.0 | 0.76 | -68.62 | 23.7 |
| 0..2 SOL | 307 | 8.89 | 4.67 | 59.6 | -2.44 | 0.66 | 50.5 | 16.47 | -41.78 | 39.4 |
| 2..5 SOL | 86 | -2.06 | 0.81 | 58.1 | -0.06 | 4.04 | 67.4 | -4.78 | 5.33 | 61.6 |
| >=5 SOL | 186 | 0.01 | 0.08 | 58.6 | 2.03 | 1.44 | 75.3 | -0.08 | 0.64 | 64.0 |
6 rows. Computed 2026-11-23T14:12:57Z.