Query editor
WITH operations AS (SELECT(SELECT MIN(output_token0) FROM uniswap_v3_arbitrum.NonfungiblePositionManager_call_positions cp WHERE rc.tokenId = cp.tokenId) AS token,shares AS amountFROM revert_finance_arbitrum.V3Vault_evt_Borrow rcUNION ALLSELECT(SELECT MIN(output_token1) FROM uniswap_v3_arbitrum.NonfungiblePositionManager_call_positions cp WHERE rc.tokenId = cp.tokenId) AS token,shares AS amountFROM revert_finance_arbitrum.V3Vault_evt_Borrow rcUNION ALLSELECT(SELECT MIN(output_token0) FROM uniswap_v3_arbitrum.NonfungiblePositionManager_call_positions cp WHERE rc.tokenId = cp.tokenId) AS token,-shares AS amountFROM revert_finance_arbitrum.V3Vault_evt_Repay rcUNION ALLSELECT(SELECT MIN(output_token1) FROM uniswap_v3_arbitrum.NonfungiblePositionManager_call_positions cp WHERE rc.tokenId = cp.tokenId) AS token,-shares AS amountFROM revert_finance_arbitrum.V3Vault_evt_Repay rc)SELECTtoken,concat((SELECT MIN(symbol) FROM tokens.erc20 WHERE contract_address = token), '_', to_hex(token)) as symbol,SUM(amount) AS collateral FROM operations GROUP BY token