Query editor
with axiom_trades as (selecttrader_id,amount_usd,block_time,casewhen token_sold_symbol = 'WSOL' then token_bought_mint_addresselse token_sold_mint_addressend as token_mint,casewhen token_sold_symbol = 'WSOL' then 'buy'else 'sell'end as sidefrom dex_solana.tradeswhere block_time > now() - interval '30' day--and project = 'pumpdotfun'and trade_source = 'FLASHX8DrLbgeR8FcfNV1F5krxYcYMUdBkrP1EPBtxB9'),wallet_daily as (selecttrader_id,count(*) as total_trades,sum(amount_usd) as total_volume_usd,count(distinct date_trunc('day', block_time)) as active_days,cast(count(*) as double) / count(distinct date_trunc('day', block_time)) as trades_per_day,sum(case when side = 'buy' then amount_usd else 0 end) as total_bought_usd,sum(case when side = 'sell' then amount_usd else 0 end) as total_sold_usdfrom axiom_tradesgroup by 1),classified as (select*,casewhen trades_per_day > 500 then 'definite_bot'when trades_per_day > 100 then 'likely_bot'when trades_per_day > 50 then 'suspicious'else 'possibly_human'end as classificationfrom wallet_daily)selectclassification,count(*) as wallet_count,sum(total_trades) as total_trades,sum(total_volume_usd) as total_volume_usd,sum(total_volume_usd) * 0.01 as estimated_axiom_fees_usd,sum(total_sold_usd) - sum(total_bought_usd) as net_pnl_usd,avg(trades_per_day) as avg_trades_per_day,avg(total_volume_usd) as avg_volume_per_wallet,-- share of totalcast(sum(total_trades) as double) / (select sum(total_trades) from classified) as trade_share,sum(total_volume_usd) / (select sum(total_volume_usd) from classified) as volume_sharefrom classifiedgroup by 1