Query editor
WITHConstants AS (SELECT151679574 AS ROUTER_BLOCK,173020225 AS START_BLOCK,177687593 AS END_BLOCK),AgentCreatedEvents AS (SELECTvarbinary_concat (from_hex('0x'),varbinary_substring (topic1, 13, 20)) AS agent,varbinary_concat (from_hex('0x'),varbinary_substring (topic2, 13, 20)) AS userFROMarbitrum.logs,Constants cWHEREblock_number >= c.ROUTER_BLOCKAND contract_address = 0xDec80E988F4baF43be69c13711453013c212feA8AND topic0 = 0x8c6e353968e7ffd60dba22ff7d2a4354af301f9d41858a35668e7292ec1301b6),FilteredLogs AS (SELECTcontract_address,data,block_timeFROMarbitrum.logs,Constants cWHEREblock_number > c.START_BLOCKAND block_number <= c.END_BLOCKAND topic0 = 0x35a3dffe7c5e557c9379dbe39253faee9171d9ddae8c79c06f9fc5813a083bf5)SELECTace.user,CASEWHEN SPLIT_PART(from_utf8(varbinary_substring (fl.data, 33, 32)),':',2) IN ('aave-v3', 'compound-v3') THEN 'Aave/Compound'WHEN SPLIT_PART(from_utf8(varbinary_substring (fl.data, 33, 32)),':',2) = 'radiant-v2' THEN 'Radiant'END AS protocol,SUM((CAST(varbinary_to_uint256 (varbinary_substring (fl.data, 1, 32)) AS DOUBLE) / 1e18) * p.price) AS fee,SUM(