Query editor
WITHmaestro_user AS (SELECT distinct"from" AS userFROMethereum.tracesWHERE"to" = 0xCac0F1A06D3f02397Cfb6D7077321d73b504916e -- maestro walletand block_time > date('2023-04-01') -- mevblocker activeAND tx_success = trueAND call_type = 'call'AND value > uint256 '0'), m_txs as (SELECT distincttxs.hash as hashFROMethereum.transactions txsJOIN maestro_user m on m.user = txs."from"WHEREblock_time > date('2023-04-01') -- mevblocker activeand txs."to" = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D)SELECTdate_trunc('month', from_unixtime(timestamp / 1000.0)) as aggregate_by,case when json_array_length(transactions) > 1 then 'bundle: ' else 'single tx: ' end||case when referrer is not null then referrerwhen m.hash is not null then 'maestro'when from_hex(CAST(json_extract(s.transactions, '$[0].to') AS VARCHAR)) = 0x3999D2c5207C06BBC5cf8A6bEa52966cabB76d41then 'UniBot (Telegram)'else 'No referrer' end as referrer,COUNT(*) as tx_countFROM mevblocker.raw_bundles sleft join m_txs m on from_hex(CAST(json_extract(s.transactions, '$[0].hash') AS VARCHAR)) = m.hashGROUP BY 1, 2order by 2