Query editor
WITH incoming AS (SELECTdecoded.to AS user_address,SUM(decoded.value) / 1e18 AS total_incoming /* Sum of incoming transfers, adjusting for 18 decimals */FROM TABLE(DECODE_EVM_EVENT(abi => '{"anonymous": false,"inputs": [{"indexed": true,"internalType": "address","name": "from","type": "address"},{"indexed": true,"internalType": "address","name": "to","type": "address"},{"indexed": false,"internalType": "uint256","name": "value","type": "uint256"}],"name": "Transfer","type": "event"}',input => TABLE(SELECT*FROM viction.logs AS tWHEREt.contract_address = 0xC054751BdBD24Ae713BA3Dc9Bd9434aBe2abc1ce /* Contract address */))) AS decodedGROUP BYdecoded.to), outgoing AS (SELECTdecoded."from" AS user_address,SUM(decoded.value) / 1e18 AS total_outgoing /* Sum of outgoing transfers, adjusting for 18 decimals */FROM TABLE(DECODE_EVM_EVENT(abi => '{"anonymous": false,"inputs": [{"indexed": true,"internalType": "address","name": "from","type": "address"},{"indexed": true,"internalType": "address",