Query editor
with user_searcher_transactions as (selectdistinct from_hex(CAST(json_extract(transactions, '$[1].hash') AS VARCHAR)) as searcher_txfrom mevblocker.raw_bundleswhere json_array_length(transactions) = 2and DATE(from_unixtime(cast(timestamp as double)/cast(1000 as double))) >= (timestamp '{{StartTime}}')and from_hex(CAST(json_extract(transactions, '$[1].from') AS VARCHAR))!=from_hex(CAST(json_extract(transactions, '$[0].from') AS VARCHAR))),searcher_txs as (select "from", index, et.block_number, hashfrom user_searcher_transactions ustinner join ethereum.transactions eton searcher_tx = hash),-- assuming that searcher transactions are immediately-- after user's and then kickbacks immediately after that-- all refunds come from the builder.possible_kickbacks as (select st.block_number, st.index, et."from", to, value, et.hashfrom searcher_txs stinner join ethereum.transactions eton st.block_number = et.block_numberand st.index + 1 = et.indexjoin ethereum.blocks bl on st.block_number = bl.numberand et."from" = bl.miner)selectto,count(*) num_kickbacks,sum(value) / 1e18 total_kickback_ethfrom possible_kickbacksgroup by toorder by sum(value) desc