Query editor
/* Right now this query only implements setTemplate and revisePool commands,as they are needed to find the pool swap fee. All other commands are eithernot necessary right now (like the ones changing the protocol take, which is zero)or too low level. */WITH eth_croc_traces AS (SELECT1 as chain_id, -- t.tx_hash as tx_hash,t.block_time, 'protocolCmd' as method,bytearray_to_integer(bytearray_substring(t.input, 4 + 29, 4)) as callpath_idx,bytearray_to_integer(bytearray_substring(t.input, 4 + 128 + 29, 4)) as cmd_idx,t.inputFROM ethereum.traces as tWHERE t.block_number > 17361664 AND t.to = 0xaaaaaaaaa24eeeb8d57d431224f73832bc34f688 AND bytearray_substring(t.input, 1, 4) = 0x13fd34f4 AND t.success), scroll_croc_traces AS (SELECT534352 as chain_id, -- t.tx_hash as tx_hash,t.block_time, 'protocolCmd' as method,bytearray_to_integer(bytearray_substring(t.input, 4 + 29, 4)) as callpath_idx,bytearray_to_integer(bytearray_substring(t.input, 4 + 128 + 29, 4)) as cmd_idx,t.inputFROM scroll.traces as tWHERE t.block_number > 267408 AND t.to = 0xaaaaaaaacb71bf2c8cae522ea5fa455571a74106 AND bytearray_substring(t.input, 1, 4) = 0x13fd34f4 AND t.success), blast_croc_traces AS (SELECT81457 as chain_id, -- t.tx_hash as tx_hash,t.block_time, 'protocolCmd' as method,bytearray_to_integer(bytearray_substring(t.input, 4 + 29, 4)) as callpath_idx,bytearray_to_integer(bytearray_substring(t.input, 4 + 128 + 29, 4)) as cmd_idx,t.inputFROM blast.traces as tWHERE t.block_number >= 182357 AND t.to = 0xaaaaaaaaffe404ee9433eef0094b6382d81fb958 AND bytearray_substring(t.input, 1, 4) = 0x13fd34f4 AND t.success), croc_traces AS (SELECT *FROM eth_croc_tracesUNION ALLSELECT *FROM scroll_croc_tracesUNION ALLSELECT *FROM blast_croc_traces), protocol_traces AS (SELECT *,CASEWHEN ((chain_id = 1 AND callpath_idx = 3 AND cmd_idx = 109) OR (chain_id = 534352 AND callpath_idx = 3 AND cmd_idx = 109) OR (chain_id = 81457 AND callpath_idx = 3 AND cmd_idx = 109)) THEN 'disableTemplate'WHEN ((chain_id = 1 AND callpath_idx = 3 AND cmd_idx = 110) OR (chain_id = 534352 AND callpath_idx = 3 AND cmd_idx = 110) OR (chain_id = 81457 AND callpath_idx = 3 AND cmd_idx = 110)) THEN 'setTemplate'WHEN ((chain_id = 1 AND callpath_idx = 3 AND cmd_idx = 111) OR (chain_id = 534352 AND callpath_idx = 3 AND cmd_idx = 111) OR (chain_id = 81457 AND callpath_idx = 3 AND cmd_idx = 111)) THEN 'poolRevise'WHEN ((chain_id = 1 AND callpath_idx = 3 AND cmd_idx = 112) OR (chain_id = 534352 AND callpath_idx = 3 AND cmd_idx = 112) OR (chain_id = 81457 AND callpath_idx = 3 AND cmd_idx = 112)) THEN 'setPoolInitLiq'WHEN ((chain_id = 1 AND callpath_idx = 3 AND cmd_idx = 113) OR (chain_id = 534352 AND callpath_idx = 3 AND cmd_idx = 113) OR (chain_id = 81457 AND callpath_idx = 3 AND cmd_idx = 113)) THEN 'setOffGrid'WHEN ((chain_id = 1 AND callpath_idx = 3 AND cmd_idx = 114) OR (chain_id = 534352 AND callpath_idx = 3 AND cmd_idx = 114) OR (chain_id = 81457 AND callpath_idx = 3 AND cmd_idx = 114)) THEN 'setProtocolTake'WHEN ((chain_id = 1 AND callpath_idx = 3 AND cmd_idx = 115) OR (chain_id = 534352 AND callpath_idx = 3 AND cmd_idx = 115) OR (chain_id = 81457 AND callpath_idx = 3 AND cmd_idx = 115)) THEN 'resyncPoolProtocolTake'WHEN ((chain_id = 1 AND callpath_idx = 3 AND cmd_idx = 116) OR (chain_id = 534352 AND callpath_idx = 3 AND cmd_idx = 116) OR (chain_id = 81457 AND callpath_idx = 3 AND cmd_idx = 116)) THEN 'setRelayerProtocolTake'END as cmdFROM croc_tracesWHERE method = 'protocolCmd'