Query editor
WITHparams AS (SELECT *FROM (VALUES('Junior Collateralized Lending Pool', 0x1f88c069a1f6daad251dda3b921358274368b96b),('Junior Secure BG RE Pool 02', 0x82f5839362cd07cc9d9653d70f033bd2866882cc),('Senior Collateralized Lending Pool', 0xa4725b4ba562205e7267635bbfc6677c59f4f22f),('Senior Secure BG RE Pool 01', 0x0d56f741c6d9b09c823e46b701505dcb93f518e4),('Senior Agri Loan Pool', 0xf4dd3d7307472f5c0a7d94e7b4d120666363614c),('Senior Agri Loan Pool 02', 0xd6fc631e243c2c323dff0e63e6d64cb615ac105e)) AS t(name, pool)),deposite_credit_pools as (SELECT"from" as depositor,sum(value)/1e6 as depositFROM erc20_arbitrum.evt_transferWHERE to IN (select pool from params) and contract_address = 0xaf88d065e77c8cc2239327c5edb3a432268e5831GROUP BY 1),widr_credit_pools as (SELECT"to" as depositor,sum(value)/1e6 as withdrawFROM erc20_arbitrum.evt_transferWHERE "from" IN (select pool from params) and contract_address = 0xaf88d065e77c8cc2239327c5edb3a432268e5831GROUP BY 1),add_all as (SELECTd.depositor,d.deposit,COALESCE(w.withdraw,0) as withdraw,d.deposit - COALESCE(w.withdraw,0) as remainderFROM deposite_credit_pools dLEFT JOIN widr_credit_pools wON d.depositor = w.depositor)SELECTdepositor as address,'USDC' as symbol,remainder as balanceFROM add_allwhere depositor NOT IN(select * FROM query_3808208)and remainder >100ORDER BY remainder DESC;