Query editor
with trades as (select tx_from as address,block_time,tx_hash,contract_address as router_address,'v3-5' as router,'ethereum' as chain,concat('0x', substr(cast(topic2 as varchar), 2 + 25, 40)) as token_in,concat('0x', substr(cast(topic3 as varchar), 2 + 25, 40)) as token_outfrom ethereum.logswhere contract_address in (0x827179dD56d07A7eeA32e3873493835da2866976,0x8516944E89f296eb6473d79aED1Ba12088016c9e,0x5550D13389bB70F45fCeF58f19f6b6e87F6e747d,0xe43ca1Dee3F0fc1e2df73A0745674545F11A59F5,0xf2614A233c7C3e7f08b1F887Ba133a13f1eb2c55)and topic0 = 0x2db5ddd0b42bdbca0d69ea16f234a870a485854ae0d91f16643d6f317d8b8994and block_time between from_iso8601_timestamp('{{from}}') and from_iso8601_timestamp('{{to}}')union allselect tx_from as address,block_time,tx_hash,contract_address as router_address,'v3-5' as router,'base' as chain,concat('0x', substr(cast(topic2 as varchar), 2 + 25, 40)) as token_in,concat('0x', substr(cast(topic3 as varchar), 2 + 25, 40)) as token_outfrom base.logswhere contract_address in (0x0BE808376Ecb75a5CF9bB6D237d16cd37893d904,0x9B77032075806975B3bd3bcFc69E5DE36ee6D176,0x83eC81Ae54dD8dca17C3Dd4703141599090751D1,0x0389879e0156033202c44bf784ac18fc02edee4f,0xf2614A233c7C3e7f08b1F887Ba133a13f1eb2c55)and topic0 = 0x2db5ddd0b42bdbca0d69ea16f234a870a485854ae0d91f16643d6f317d8b8994and block_time between from_iso8601_timestamp('{{from}}') and from_iso8601_timestamp('{{to}}')union allselect tx_from as address,block_time,tx_hash,contract_address as router_address,'v3-5' as router,'arbitrum' as chain,concat('0x', substr(cast(topic2 as varchar), 2 + 25, 40)) as token_in,concat('0x', substr(cast(topic3 as varchar), 2 + 25, 40)) as token_outfrom arbitrum.logswhere contract_address in (0xfc506AaA1340b4dedFfd88bE278bEe058952D674,0x09bd2a33c47746ff03b86bce4e885d03c74a8e8c,0x544bA588efD839d2692Fc31EA991cD39993c135F,0x3c1fBA3bCEE7CE410B155a8C71F9fF1312852C82,0xf2614A233c7C3e7f08b1F887Ba133a13f1eb2c55)and topic0 = 0x2db5ddd0b42bdbca0d69ea16f234a870a485854ae0d91f16643d6f317d8b8994and block_time between from_iso8601_timestamp('{{from}}') and from_iso8601_timestamp('{{to}}')union all