Query editor
WITH spent as((SELECT tx_hash,(bytearray_to_int256(SUBSTR(data, 110, 19))/1e+18) as value, topic1 as walletFROM ethereum.logsWHERE contract_address = 0x3cbc0b5AF6A1F9B197bbC7F33B982b740e58065fAND topic2 IS NOT NULL)UNION ALL(SELECT tx_hash,(bytearray_to_int256(SUBSTR(data, 110, 19))/1e+18) as value, topic1 as walletFROM polygon.logsWHERE contract_address = 0x011C1a01012f952cFf47d050CA23704612Ce0ae8AND topic2 IS NOT NULL))SELECT sum(value)FROM spent