Query editor
WITH decoded_events AS (SELECTblock_time, -- when the tx was minedblock_number, -- which blocktx_hash, -- transaction hashtopic1 AS asset_address, -- indexed params go to topics, address is stored in topic1-- Data field: non-indexed parametersbytearray_to_uint256(bytearray_substring(data, 1, 32)) AS amount_wei, -- extract bytes 1-32 from data which is amountbytearray_to_uint256(bytearray_substring(data, 33, 32)) AS premium_wei -- extract bytes 33 + 32 bytes more which premiumFROM sepolia.logsWHERE contract_address = 0x7e2BDC7aD640e7Fc87aFb0b16774d3f4F874e7A6 -- we only want events from my smart contractAND topic0 = 0x61268d74931c41c9775dffb6169a5208aab1d09cb2eb6aabe8b97162801e5dfa -- we only want this specified event, which is FlashLoanExecuted-- this hash uniquely identifies that event)SELECTblock_time,tx_hash,bytearray_substring(asset_address, 13, 20) AS token_address,amount_wei / 1e18 AS amount_eth,premium_wei / 1e18 AS premium_eth,(premium_wei * 100.0 / amount_wei) AS fee_percentageFROM decoded_eventsORDER BY block_time DESC