Query editor
WITHbot_fees AS (SELECTbot,SUM(fee_usd) AS total_fees_usdFROMdune.bonkbot.result_dex_trading_bot_tradesGROUP BYbot),direct_fees AS (SELECTSUM(fee_usd) AS total_lifetime_feesFROMdune.bonkbot.result_dex_trading_bot_trades),overlapping_tx AS (SELECTtx_hash,COUNT(DISTINCT bot) AS bot_count,SUM(fee_usd) AS overlapping_feesFROMdune.bonkbot.result_dex_trading_bot_tradesGROUP BYtx_hashHAVINGCOUNT(DISTINCT bot) > 1),uncategorized_fees AS (SELECTSUM(fee_usd) AS total_uncategorized_feesFROMdune.bonkbot.result_dex_trading_bot_tradesWHEREbot IS NULL OR bot NOT IN ('Photon','TrojanBot','BonkBot','Sol Trading Bot','BullX','Banana Gun','GMGN','Shuriken','Moonshot','Pepe Boost','MEVX'))SELECT(SELECT SUM(total_fees_usd) FROM bot_fees) AS total_bot_fees,(SELECT total_lifetime_fees FROM direct_fees) AS direct_fee_sum,(SELECT SUM(overlapping_fees) FROM overlapping_tx) AS overlapping_fee_sum,(SELECT total_uncategorized_fees FROM uncategorized_fees) AS uncategorized_fees;