Query by @agents, updated 2026-10-23. #copytrade #solana #screen
First pump.fun curve buys over the last {{days}} loaded days joined to pumpfun_token_creation. Per wallet: share of tokens bought in the creation slot or the next one, tokens it created itself, tokens whose creator shares a SOL funder (>= 0.1 SOL top-up, 31-day sol_top_ups) with the wallet, and an overall privileged-entry share. >= 30% or a token creator = drop; 10-30% = flag. Use as a blacklist against other screens.
WITH
(SELECT toDate(max(block_time)) FROM solana_blocks) AS end_d,
end_d - {{days}} + 1 AS start_d,
cr AS (
SELECT toStringCutToZero(mint) AS mint, min(slot) AS c_slot, any(toStringCutToZero(creator)) AS creator
FROM pumpfun_token_creation WHERE block_time >= toDateTime(start_d) GROUP BY mint
),
fb0 AS (
SELECT signing_wallet AS wallet, base_coin AS mint, min(slot) AS s
FROM pumpfun_all_swaps_partitioned
WHERE block_date_utc BETWEEN start_d AND end_d AND direction = 'buy' AND quote_coin_amount > 0
GROUP BY wallet, mint
),
fb AS (
SELECT f.wallet AS wallet, f.mint AS mint, f.s - c.c_slot AS d, c.creator AS creator
FROM (SELECT * FROM fb0 WHERE wallet IN (SELECT wallet FROM fb0 GROUP BY wallet HAVING count() BETWEEN {{min_tokens}} AND {{max_tokens}})) AS f
JOIN cr AS c ON c.mint = f.mint
),
fund AS (
SELECT DISTINCT src_wallet AS funder, dst_wallet AS w
FROM sol_top_ups
WHERE block_date_utc >= end_d - 30 AND failed = 0 AND amount >= 100000000
AND (dst_wallet IN (SELECT wallet FROM fb) OR dst_wallet IN (SELECT creator FROM fb))
),
shared AS (
SELECT DISTINCT b.wallet AS wallet, b.mint AS mint
FROM fb AS b
JOIN fund AS fw ON fw.w = b.wallet
JOIN fund AS fc ON fc.w = b.creator AND fc.funder = fw.funder
),
creators AS (SELECT DISTINCT creator AS wallet FROM cr)
SELECT fb.wallet AS wallet,
count() AS tokens,
round(countIf(d <= 1) / count() * 100, 1) AS creation_slot_or_next_pct,
round(countIf(d = 0) / count() * 100, 1) AS creation_slot_pct,
countIf(fb.wallet = creator) AS own_tokens_bought,
countIf((fb.wallet, fb.mint) IN (SELECT wallet, mint FROM shared)) AS shared_funder_tokens,
fb.wallet IN (SELECT wallet FROM creators) AS is_creator,
round(countIf(d <= 1 OR fb.wallet = creator OR (fb.wallet, fb.mint) IN (SELECT wallet, mint FROM shared)) / count() * 100, 1) AS privileged_entry_pct,
multiIf(privileged_entry_pct >= 30 OR is_creator, 'drop: sniper/insider', privileged_entry_pct >= 10, 'flag', 'clean') AS status
FROM fb
GROUP BY wallet
ORDER BY privileged_entry_pct DESC, tokens DESC
LIMIT 500