Query editor
-- copypump (https://www.copypumpfun.com) -- Telegram copy-trading bot on pump.fun, Solana only.-- Every copied trade is a transaction co-signed by the user's wallet and the copypump fee payer,-- which pays the transaction fee and the rent of the token accounts the route creates.-- The service fee is collected separately, as a USDC transfer to the copypump treasury.---- fees_usd USDC received by the treasury that day (the service fee, collected per trade)-- cost_usd SOL the fee payer lost in its own transactions (signature fees + rent, NET of the-- rent it gets back when empty token accounts are closed to it), priced at the daily-- SOL price; its top-ups (co-signed by the treasury) are excluded, failed txs count-- revenue_usd fees_usd - cost_usd-- volume_usd one USD value per copied trade: the largest hop of the route (every hop of a-- multi-hop route carries the same value, so summing hops would double count)-- trades copied trades (transactions with at least one DEX swap), buys / sells by the-- last hop: a route that ends in USDC or SOL is a sellwithtreasury as (select 'BjHYEPvpHj1CgmhsJKzmSCmDbtzoy2nYu7XTr5nLu1Ev' as a),payer as (select 'DQg2Uxvbh4JJD6bFHPCsoLJ9SGgNv1qkvksHy8MVfV7D' as a),cash as (select mint from (values ('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'), ('So11111111111111111111111111111111111111112')) as t(mint)),days as (select cast(d as date) as dayfrom unnest(sequence(date '2026-09-16', current_date, interval '1' day)) as t(d)),fees as (select block_date as day, sum(amount_display) as fees_usdfrom tokens_solana.transferswhere to_owner = (select a from treasury)and token_mint_address = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'and block_date >= date '2026-09-16'group by 1),ours as (select id, block_date, success,pre_balances[1] - post_balances[1] as lamports_out -- net : the rent it gets back (empty token accounts closed to it) counts negativefrom solana.transactionswhere signer = (select a from payer) and block_date >= date '2026-09-16'and not contains(signers, (select a from treasury)) -- a top-up (SOL from the treasury) is co-signed by it : not a cost, not a gain),sol_px as (select day, price from prices.usd_daily where blockchain = 'solana' and symbol = 'SOL' and day >= date '2026-09-16'),cost as (-- today has no daily price yet : fall back to the latest oneselect o.block_date as day,sum(o.lamports_out) / 1e9 * coalesce(max(p.price), (select price from sol_px order by day desc limit 1)) as cost_usdfrom ours oleft join sol_px p on p.day = o.block_dategroup by 1),legs as (select t.block_date, t.tx_id, t.amount_usd, t.token_bought_mint_address as bought,row_number() over (partition by t.tx_id order by t.outer_instruction_index desc, t.inner_instruction_index desc) as rn_lastfrom dex_solana.trades tjoin ours o on o.id = t.tx_id and o.block_date = t.block_date and o.successwhere t.block_date >= date '2026-09-16'),per_tx as (select block_date, tx_id, max(amount_usd) as usd,max(case when rn_last = 1 and bought in (select mint from cash) then 1 else 0 end) as is_sellfrom legs group by 1, 2),