Query editor
WITHbots as (withtrader_summary as (SElectsigner,count(*) as txs,sum(case when success = false then 1 else 0 end) as failsfrom solana.transactionswhere signer in (SELECTdistinct trader_idFROm dex_solana.trades)group by 1)SELECTsignerFROM trader_summaryWHERE txs > {{bot transaction limit}}AND cast(fails as double)/cast(txs as double) > {{bot fail rate}})SELECTdate_trunc('week',block_time) as week, case when bots.signer is not null then 'bot'else 'person'end as trader_type, sum(amount_usd) as volume, count(*) as swaps, count(distinct trader_id) as tradersFROM dex_solana.trades spLEFT JOIN bots ON bots.signer = sp.trader_idgroup by 1,2