Query by @astrolabe-pumpfun, updated 2026-11-05. #pumpfun #pnl #traders #wallets
Example query
WITH
pos AS (
SELECT
toStringCutToZero(signing_wallet) AS wallet,
toStringCutToZero(base_coin) AS mint,
sumIf(quote_coin_amount, direction = 'buy') / 1e9 AS sol_in,
sumIf(quote_coin_amount, direction = 'sell') / 1e9 AS sol_out,
sumIf(base_coin_amount, direction = 'buy') AS tok_bought,
sumIf(base_coin_amount, direction = 'sell') AS tok_sold,
count() AS trades,
sum(fee) / 1e9 AS fees_sol,
any(transform(parent_program,
['', 'JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4', 'DF1ow4tspfHX9JwWJsAb9epbkA8hmpSEAtxXy1V27QBH',
'T1TANpTeScyeqVzzgNViGDNrkQ6qHz9KrSBS4aNXvGT', 'GMGNreQcJFufBiCTLDBgKhYEfEe9B454UjpDr5CaSLA1',
'GMgnVFR8Jb39LoXsEVzb3DvBy3ywCmdmJquHUy1Lrkqb', 'MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e'],
['direct call', 'Jupiter', 'DFlow', 'Titan', 'GMGN', 'GMGN', 'Pump.fun Mayhem'],
concat(substring(parent_program, 1, 6), '…'))) AS router
FROM pumpfun_v2_swaps
WHERE failed = 0 AND block_date_utc >= toDate((SELECT max(block_time) FROM solana_blocks) - INTERVAL {{hours}} HOUR) AND block_time > (SELECT max(block_time) FROM solana_blocks) - INTERVAL {{hours}} HOUR AND block_time <= (SELECT max(block_time) FROM solana_blocks)
GROUP BY wallet, mint
),
last_state AS (
-- the curve's virtual reserves after the token's last trade in the window
SELECT toStringCutToZero(base_coin) AS mint,
argMax(virtual_sol_balance_after, (block_time, slot, tx_idx)) AS vsol,
argMax(virtual_token_balance_after, (block_time, slot, tx_idx)) AS vtok
FROM pumpfun_v2_swaps
WHERE failed = 0 AND block_date_utc >= toDate((SELECT max(block_time) FROM solana_blocks) - INTERVAL {{hours}} HOUR) AND block_time > (SELECT max(block_time) FROM solana_blocks) - INTERVAL {{hours}} HOUR AND block_time <= (SELECT max(block_time) FROM solana_blocks) AND virtual_token_balance_after > 0
GROUP BY mint
),
position AS (
SELECT wallet, mint, sol_in, sol_out, trades, fees_sol, router,
greatest(tok_bought - tok_sold, 0) AS tok_left,
-- what selling the remaining tokens into the curve would return now: constant product, minus the 1% fee
if(tok_left > 0, toFloat64(vsol) * tok_left / (toFloat64(vtok) + tok_left) / 1e9 * 0.99, 0) AS held_sol,
sol_out - sol_in AS realized_sol,
sol_out - sol_in + held_sol AS pnl_sol
FROM pos
LEFT JOIN last_state USING mint
),
wallets AS (
SELECT wallet,
sum(pnl_sol) AS pnl,
sum(realized_sol) AS realized,
sum(held_sol) AS held,
sum(sol_in) + sum(sol_out) AS volume,
sum(sol_in) AS bought,
sum(trades) AS n_trades,
count() AS n_tokens,
countIf(pnl_sol > 0) AS n_tokens_won,
sum(fees_sol) AS fees,
argMax(router, trades) AS main_router,
-- a signer with thousands of tokens in a day is a bundler or relayer signing for other people, not a trader
(sum(trades) > 50000 OR count() > 3000) AS infra
FROM position
GROUP BY wallet
)
SELECT
main_router AS router,
count() AS wallets,
sum(n_trades) AS trades,
round(countIf(pnl > 0) / count() * 100, 1) AS winners_pct,
round(median(pnl), 3) AS median_pnl_sol,
round(sum(pnl)) AS total_pnl_sol,
round(sum(volume)) AS volume_sol
FROM wallets
GROUP BY router
HAVING wallets >= 100
ORDER BY total_pnl_sol DESCCharts: Share of wallets in profit, by router.
| router | wallets | trades | winners_pct | median_pnl_sol | total_pnl_sol | volume_sol |
|---|---|---|---|---|---|---|
| 6Vo324… | 24531 | 549029 | 53.3 | 0.001 | 999207.0 | 14205083.0 |
| direct call | 43890 | 1208475 | 55.1 | 0.003 | 539782.0 | 7423824.0 |
| J7pour… | 634 | 23677 | 42.1 | -0.0 | 166517.0 | 943324.0 |
| DFlow | 10434 | 72107 | 48.1 | -0.0 | 124139.0 | 1343933.0 |
| term9Y… | 4513 | 115569 | 47.6 | -0.0 | 89343.0 | 2302801.0 |
| Jupiter | 12108 | 112523 | 48.8 | -0.0 | 53411.0 | 1200324.0 |
| m9obQH… | 459 | 14284 | 56.0 | 0.027 | 18749.0 | 191572.0 |
| rapidV… | 143 | 5799 | 60.8 | 0.059 | 12318.0 | 96265.0 |
| GMGN | 7727 | 130114 | 47.9 | -0.0 | 11973.0 | 1677939.0 |
| Maestr… | 406 | 2627 | 53.9 | 0.005 | 3220.0 | 23239.0 |
| Aveaiu… | 374 | 3448 | 46.8 | -0.0 | 2569.0 | 33101.0 |
| BBRout… | 218 | 2475 | 49.1 | -0.0 | 2453.0 | 40010.0 |
| 4KRSet… | 157 | 3438 | 42.0 | -0.001 | 1761.0 | 20022.0 |
| B3111y… | 326 | 2630 | 48.8 | -0.0 | 724.0 | 14135.0 |
| FAdo9N… | 685 | 10156 | 44.7 | -0.0 | 133.0 | 1479.0 |
| 6i5MQf… | 326 | 1538 | 67.2 | 0.123 | 70.0 | 315.0 |
| 7ncUFd… | 311 | 1580 | 65.9 | 0.121 | 70.0 | 307.0 |
| ER3v9U… | 275 | 1391 | 62.5 | 0.123 | 70.0 | 305.0 |
| 8MnNNs… | 274 | 1369 | 66.4 | 0.127 | 65.0 | 285.0 |
| CURP4s… | 292 | 1394 | 67.1 | 0.139 | 64.0 | 303.0 |
| FtytkM… | 321 | 1582 | 65.1 | 0.119 | 62.0 | 303.0 |
| Xim9dG… | 308 | 1502 | 64.6 | 0.119 | 60.0 | 297.0 |
| CJudoh… | 301 | 1400 | 66.4 | 0.115 | 60.0 | 288.0 |
| 5TnE7D… | 299 | 1571 | 66.9 | 0.133 | 60.0 | 317.0 |
| AeJiDz… | 301 | 1542 | 67.8 | 0.126 | 58.0 | 324.0 |
| 5UWsHi… | 286 | 1399 | 69.2 | 0.158 | 56.0 | 303.0 |
| HdwjJk… | 321 | 1620 | 62.9 | 0.128 | 56.0 | 391.0 |
| 6GBsYw… | 302 | 1548 | 59.9 | 0.097 | 56.0 | 321.0 |
| 5ChUiJ… | 322 | 1540 | 64.9 | 0.123 | 56.0 | 299.0 |
| CHNUGG… | 320 | 1644 | 63.4 | 0.105 | 55.0 | 369.0 |
First 30 of 87 rows. Computed 2026-11-05T13:17:16Z.