Query editor
-- ============================================================-- Aave V3 Ethereum: ETH-collateral / stablecoin-debt candidates---- Conditions:-- 1. total_debt_usd >= 1,000,000-- 2. eth_related_collateral_usd / total_collateral_usd >= 0.70-- 3. Every outstanding debt reserve must be one of:-- USDC, USDT, DAI, GHO---- Final output:-- user_address---- Note:-- Balances are reconstructed from aToken/debtToken Transfer events.-- The backend should read exact on-chain balances for final PI calculation.-- ============================================================WITH/* ------------------------------------------------------------0. Adjustable screening parameters------------------------------------------------------------ */params AS (SELECT1000000.0 AS min_debt_usd,0.70 AS min_eth_collateral_ratio),/* ------------------------------------------------------------1. Asset classificationsETH-related collateral:WETH, wstETH, weETH, rsETH, cbETHAllowed debt assets:USDC, USDT, DAI, GHO------------------------------------------------------------ */asset_labels AS (SELECT *FROM (VALUES(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2,true,false), -- WETH(0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0,true,false), -- wstETH(0xcd5fE23C85820F7B72D0926FC9b05b43E359b7ee,true,false), -- weETH(