Query editor
WITH total_transactions AS (SELECT COUNT(*) as total_countFROM dex_solana.tradesWHERE token_bought_symbol = 'POPCAT'OR token_sold_symbol = 'POPCAT'),trader_counts AS (SELECTtrader_id,COUNT(*) AS transaction_count,SUM(amount_usd) as total_volumeFROM dex_solana.tradesWHEREtoken_bought_symbol = 'POPCAT'OR token_sold_symbol = 'POPCAT'GROUP BYtrader_id),ranked_traders AS (SELECTtc.trader_id,tc.transaction_count,tc.total_volume,tc.transaction_count * 100.0 / tt.total_count AS active_ratio,SUM(tc.transaction_count) OVER (ORDER BY tc.transaction_count DESC) * 100.0 / tt.total_count AS cumulative_ratioFROM trader_counts tcCROSS JOIN total_transactions tt)SELECT *FROM ranked_tradersORDER BY transaction_count DESCLIMIT 10;