Query editor
-- Aave v3 stablecoin (USDC/USDT, USDT0 on Plasma) deposit APY across chains.-- Reserve addresses hardcoded directly (canonical USDC/USDT contracts per chain)-- since the stablecoins_multichain.tokens lookup table was deprecated/restructured.---- METHODOLOGY FIX: previously used the single LAST ReserveDataUpdated event of-- each day as that day's rate. This is fragile -- liquidityRate can spike-- briefly (e.g. a large single borrow/repay momentarily maxing utilization)-- and picking the literal last snapshot of the day can land exactly on such a-- spike, roughly doubling the reported rate on affected days (confirmed: on-- 2026-09-21, Ethereum USDC ranged 3.53%-12.96% intraday across 3,030 events;-- the last event of the day was 12.96%, an outlier, vs a true intraday-- average of 4.19% -- much closer to Aave's own frontend figure).-- Now uses the AVERAGE of all events within each day per reserve instead,-- which is far more representative and robust to momentary spikes.WITH stablecoin_reserves(blockchain, reserve, symbol) AS (VALUES('ethereum', from_hex('a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'), 'USDC'),('ethereum', from_hex('dac17f958d2ee523a2206206994597c13d831ec7'), 'USDT'),('arbitrum', from_hex('af88d065e77c8cc2239327c5edb3a432268e5831'), 'USDC'),('arbitrum', from_hex('fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9'), 'USDT'),('polygon', from_hex('3c499c542cef5e3811e1192ce70d8cc03d5c3359'), 'USDC'),('polygon', from_hex('c2132d05d31c914a87c6611c10748aeb04b58e8f'), 'USDT'),('base', from_hex('833589fcd6edb6e08f4c7c32d4f71b54bda02913'), 'USDC'),('bnb', from_hex('8ac76a51cc950d9822d68b83fe1ad97b32cd580d'), 'USDC'),('bnb', from_hex('55d398326f99059ff775485246999027b3197955'), 'USDT'),('plasma', from_hex('b8ce59fc3717ada4c02eadf9682a9e934f625ebb'), 'USDT')),raw_events AS (SELECT 'ethereum' AS blockchain, evt_block_date, evt_block_time, reserve, liquidityRateFROM aave_v3_ethereum.pool_evt_reservedataupdatedWHERE evt_block_date >= DATE '2025-07-01'UNION ALLSELECT 'arbitrum', evt_block_date, evt_block_time, reserve, liquidityRateFROM aave_v3_arbitrum.l2pool_evt_reservedataupdatedWHERE evt_block_date >= DATE '2025-07-01'UNION ALLSELECT 'polygon', evt_block_date, evt_block_time, reserve, liquidityRateFROM aave_v3_polygon.pool_evt_reservedataupdatedWHERE evt_block_date >= DATE '2025-07-01'UNION ALLSELECT 'base', evt_block_date, evt_block_time, reserve, liquidityRateFROM aave_v3_base.l2pool_evt_reservedataupdatedWHERE evt_block_date >= DATE '2025-07-01'UNION ALLSELECT 'bnb', evt_block_date, evt_block_time, reserve, liquidityRateFROM aave_v3_bnb.pool_evt_reservedataupdatedWHERE evt_block_date >= DATE '2025-07-01'UNION ALLSELECT 'plasma', evt_block_date, evt_block_time, reserve, liquidityRateFROM aave_v3_plasma.poolinstance_evt_reservedataupdatedWHERE evt_block_date >= DATE '2025-07-01'),filtered AS (SELECT r.blockchain, r.evt_block_date, r.reserve, r.liquidityRate, s.symbolFROM raw_events rINNER JOIN stablecoin_reserves s ON r.blockchain = s.blockchain AND r.reserve = s.reserve),reserve_daily_avg AS (SELECT