Query editor
WITH decoded_events AS (SELECTblock_time,block_number,tx_hash,topic1 AS asset_address,bytearray_to_uint256(bytearray_substring(data, 1, 32)) AS amount_wei,bytearray_to_uint256(bytearray_substring(data, 33, 32)) AS premium_weiFROM sepolia.logsWHERE contract_address = 0x7e2BDC7aD640e7Fc87aFb0b16774d3f4F874e7A6AND topic0 = 0x61268d74931c41c9775dffb6169a5208aab1d09cb2eb6aabe8b97162801e5dfa)SELECTCOUNT(*) AS total_flash_loans,ROUND(SUM(amount_wei / 1e18), 6) AS total_borrowed_eth,ROUND(SUM(premium_wei / 1e18), 6) AS total_premium_paid_eth,ROUND(AVG((premium_wei * 100.0) / amount_wei), 4) AS avg_fee_percentageFROM decoded_events