Query editor
SELECTt.symbol,sum(balance)total_balance, sum(tvl) tvlfrom query_5710149 qLEFT JOIN tokens.erc20 AS t ON t.contract_address = q.token_addressAND t.blockchain = 'ethereum'wheretoken_type = 'debttoken' and address <> 0x0000000000000000000000000000000000000000andtime in (select max(time) from query_5710149 )and addressin(SELECTaddressfrom query_5710149 qLEFT JOIN tokens.erc20 AS t ON t.contract_address = q.token_addressAND t.blockchain = 'ethereum'where q.symbol like '%aEthPT%'and token_type = 'atoken' and address <> 0x0000000000000000000000000000000000000000andtime in (select max(time) from query_5710149 )--and address in (select address from query_5710149 where aave_token_address = 0x4f5923fc5fd4a93352581b38b7cd26943012decf)--and address in (select address from query_5710149 where aave_token_address = 0x4579a27af00a62c0eb156349f31b345c08386419 )--and address not in (select address from query_5710149 where aave_token_address not inorder by time desc,balance desc) group by t.symbol