Query editor
selectdistinctblockchain,split(name, ':')[1] as protocol_name,name as contract_name,casewhen split(name, ':')[1] in ('Gmx', 'Gmx_v2', 'Vertex', 'Gains_network','Hmx', 'Pear_protocol','Gmx_v21','Mux','Pingu_exchange','Gains_network_usdc', 'Level_finance') then 'Derivative'when split(name, ':')[1] in ('Aave_v3', 'Aave_v2', 'Radiant_capital', 'Gains_network','Dolomite','Compound_v3','Silo_finance', 'Morpho_blue','Fluxfinance','Compound_ethereum_v3_usds') then 'Lending Market'when split(name, ':')[1] in ('Chainlink', 'Pyth') then 'Oracle'when split(name, ':')[1] in ('Tether', 'Circle') then 'Stablecoin'when split(name, ':')[1] in ('Hyperliquid', 'Across_v2', 'Layerzero','Wormhole','Connext','Axelar','Stargate_v2', 'Lifi','Synapse') then 'Bridge'when split(name, ':')[1] in ('Uniswap_v3', 'Uniswap', 'Camelot_v3', 'Fraxswap','Paraswap','Pancakeswap_v3','Sushiswap','Curvefi','Balancer_v2','Trader_joe','Trader_joe_v2_2','Trader_joe_v2_1','Sushiswap_v3_pool','Sushi','Curveusdm_3crv') then 'DEX'when split(name, ':')[1] in ('Erc4337') then 'Account Abstraction'when split(name, ':')[1] in ('Oneinch', 'Odos_v2', 'Okx','Zeroex','Rainbow_swap_aggregator','Kyber') then 'DEX Aggregator'when split(name, ':')[1] in ('Revert_finance') then 'Liquidity Management'when split(name, ':')[1] in ('Gnosis_protocol_v2','Gnosis_safe') then 'Safe Wallet'when split(name, ':')[1] in ('Pendle', 'Yield_yak', 'Penpie','Magpie','Yearn_v2') then 'Yield'when split(name, ':')[1] in ('Beefy') then 'Yield Aggregator'when split(name, ':')[1] in ('Kelpdao', 'Etherfi', 'Renzo','Eigenpie') then 'Liquid Restaking'when split(name, ':')[1] in ('Karak_v2', 'Karak', 'Eigenlayer','Symbiotic') then 'Restaking'when split(name, ':')[1] in ('Abracadabra') then 'CDP'when split(name, ':')[1] in ('Ondofinance') then 'Tokenization'end as category,addressfrom labels.addresseswhere category = 'contracts'unionselect 'arbitrum' as blockchain, 'gmx' as protocol_name, null as contract_name, 'Derivative' as category, 0xe68caaacdf6439628dfd2fe624847602991a31eb as addressunionselect 'arbitrum' as blockchain, 'gmx' as protocol_name, 'gmx: liquidationhadnler' as contract_name, 'Derivative' as category, 0xdab9ba9e3a301ccb353f18b4c8542ba2149e4010 as addressunionselect 'arbitrum' as blockchain, 'gmx' as protocol_name, 'gmx: exchangerouter' as contract_name, 'Derivative' as category, 0xe7bfff2ab721264887230037940490351700a068 as addressunionselect 'ethereum' as blockchain, 'Ondofinance' as protocol_name, 'Ondofinance: redemption wallet' as contract_name, 'Tokenization' as category, 0x72be8c14b7564f7a61ba2f6b7e50d18dc1d4b63d as addressunionselect 'ethereum' as blockchain, 'Pendle' as protocol_name, 'Pendle: SY Ethena USDe (SY-USDe)' as contract_name, 'Yield' as category, 0x4dB99b79361F98865230f5702de024C69f629fEC as addressunionselect 'ethereum' as blockchain, 'Karak' as protocol_name, 'Karak: KUSDe' as contract_name, 'Restaking' as category, 0xBE3cA34D0E877A1Fc889BD5231D65477779AFf4e as addressunionselect 'ethereum' as blockchain, 'Zircuit' as protocol_name, 'Zircuit: Restaking Pool' as contract_name, 'Restaking' as category, 0xF047ab4c75cebf0eB9ed34Ae2c186f3611aEAfa6 as addressunionselect * from (select blockchain,case when (txn_count>10000 and failed_txns/txn_count>0.8) or (to in (select distinct tx_from from dex.atomic_arbitrages)) then 'Potential Bots' else null end as protocol_name,null as contract_name,'Potential Bots' as category,to as addressfrom (select blockchain, to, cast(count(distinct hash) as double) as txn_count,sum(case when success = false then 1 else 0 end) as failed_txnsfrom evms.transactionswhere to in (select distinct address from evms.creation_traces)group by 1,2)a)bwhere protocol_name = 'Potential Bots'