Query editor
-- SSS Week 6 - Mem “funding” source-- Task description: for each meme-coin created on Pump Fun,-- to identify a wallet that funded the creator’s (dev) wallet.-- Solution is with bonus parts implemented:-- 1.-- is_fresh: true if first_transfer_time is-- within the past 24 hours of token_created_at-- 2.-- first funding wallet is without 1-week cutoff-- materialized in dune."0xedmund".result_address_first_sol_fundingWITH recent_tokens AS (SELECTf.token_mint_address, f.created_at, f.init_txFROM tokens_solana.fungible f-- only inspecting new tokens created within this timeframeWHERE f.created_at >= TIMESTAMP '2025-05-15 12:00:00'AND f.created_at < TIMESTAMP '2025-05-15 12:30:00'-- filter only for pump fun tokensAND "RIGHT"(f.token_mint_address, 4) = 'pump'AND token_version = 'spl_token')-- get creator wallet from tx_signer of token mint txn, transfers AS (SELECTtx_id, tx_signerFROM tokens_solana.transfers tWHERE t.block_time >= TIMESTAMP '2025-05-15 12:00:00'AND t.block_time < TIMESTAMP '2025-05-15 12:30:00'AND t.action = 'mint'), final AS (SELECTr.token_mint_address, r. created_at AS token_created_at, res.first_transfer_time, res.funding_wallet, t.tx_signer AS creator_wallet, res.amount_sol, res.funding_tx, r.init_tx AS creating_tx-- is_fresh is true if first_transfer_time is within past 24 hours of token creation, CASEWHEN res.first_transfer_time IS NULL THEN NULLWHEN res.first_transfer_time >= r.created_at - INTERVAL '24' HOUR THEN TRUEELSE FALSEEND AS is_freshFROM recent_tokens rJOIN transfers tON r.init_tx = t.tx_id-- join to reference table containing first funding informationLEFT JOIN dune."0xedmund".result_address_first_sol_funding resON t.tx_signer = res.owner)