Query editor
-- USDC supplied to lending on each chain at each month end since January 2025, for two protocol families: Morpho markets and Aave v3 reserves.-- Morpho: supply of each market whose loan token is USDC on the last day of the month, from saved daily market tables built from the Morpho contract events on every chain.-- Markets that have held 1 million US dollars or more of debt are read. Markets with all supply lent out for a run of days, and markets on Morpho's public exclusion list, are left out.-- Aave v3: the USDC reserve token's total supply, rebuilt from its mint and burn events as scaled amounts times the reserve index of the last event in the month. Native and bridged USDC reserves are both counted.-- A dollar in a Morpho vault is counted once, in the market the vault lends it to; vault cash not lent out is not counted. Other lending protocols are not read.-- base_share is Base over all chains read, within the family and for the two families together. The last month is read at November 16, 2026.-- Rows run from the first month to the last. month_label is the month as text for a chart axis; base_share_pct_latest_month repeats the latest month's share for the two families together on every row.WITH months AS (SELECT m AS month, least(date_add('day', -1, date_add('month', 1, m)), DATE '2026-11-16') AS month_endFROM UNNEST(sequence(DATE '2025-01-01', DATE '2026-11-01', INTERVAL '1' MONTH)) AS t(m)),ms AS (SELECT s.chain, s.day, s.supplied_usdFROM dune.paigeisonfire.result_borrow_collateral_market_state_daily sLEFT JOIN dune.paigeisonfire.result_borrow_collateral_market_exclusions e ON e.chain = s.chain AND e.market_id = s.market_id AND s.day >= e.excluded_fromWHERE s.days_pinned = 0 AND e.market_id IS NULL AND s.day IN (SELECT month_end FROM months)UNION ALLSELECT s.chain, s.day, s.supplied_usdFROM dune.paigeisonfire.result_borrow_collateral_other_chain_state_daily sJOIN dune.paigeisonfire.result_borrow_collateral_other_chain_registry r ON r.chain = s.chain AND r.market_id = s.market_idWHERE upper(r.loan_symbol) IN ('USDC', 'USDC.E', 'USDBC') AND s.days_pinned = 0 AND s.day IN (SELECT month_end FROM months)),morpho AS (SELECT 'Morpho' AS family, chain, CAST(date_trunc('month', day) AS DATE) AS month, SUM(supplied_usd) AS supplied_usd FROM ms GROUP BY 1, 2, 3),res AS (SELECT r.chain, r.atoken, t.decimalsFROM aave_v3_multichain.poolconfigurator_evt_reserveinitialized rJOIN tokens.erc20 t ON t.blockchain = r.chain AND t.contract_address = r.assetWHERE upper(t.symbol) IN ('USDC', 'USDC.E', 'USDBC')),legs AS (SELECT m.chain, m.contract_address AS atoken, m.evt_block_date AS day, m.evt_block_number AS bn, m.evt_index AS ix, CAST(m.index AS DOUBLE) / 1e27 AS idx,(CAST(m.value AS DOUBLE) - CAST(m.balanceincrease AS DOUBLE)) / (CAST(m.index AS DOUBLE) / 1e27) AS scaledFROM aave_v3_multichain.atoken_evt_mint m JOIN res r ON r.chain = m.chain AND r.atoken = m.contract_addressWHERE m.evt_block_date <= DATE '2026-11-16'UNION ALLSELECT b.chain, b.contract_address, b.evt_block_date, b.evt_block_number, b.evt_index, CAST(b.index AS DOUBLE) / 1e27,-(CAST(b.value AS DOUBLE) + CAST(b.balanceincrease AS DOUBLE)) / (CAST(b.index AS DOUBLE) / 1e27)FROM aave_v3_multichain.atoken_evt_burn b JOIN res r ON r.chain = b.chain AND r.atoken = b.contract_addressWHERE b.evt_block_date <= DATE '2026-11-16'),am AS (SELECT chain, atoken, date_trunc('month', day) AS month, SUM(scaled) AS d_scaled, max_by(idx, (bn, ix)) AS idx_endFROM legs GROUP BY 1, 2, 3),aave AS (SELECT 'Aave v3' AS family, q.chain, CAST(q.month AS DATE) AS month, SUM(q.sc * q.idx_end / POWER(10, r.decimals)) AS supplied_usdFROM (SELECT chain, atoken, month, idx_end, SUM(d_scaled) OVER (PARTITION BY chain, atoken ORDER BY month) AS sc FROM am) qJOIN res r ON r.chain = q.chain AND r.atoken = q.atokenGROUP BY 1, 2, 3),u AS (SELECT * FROM morpho UNION ALL SELECT * FROM aave),keys AS (SELECT DISTINCT family, chain FROM u),grid AS (SELECT k.family, k.chain, mo.month, mo.month_end,(SELECT max_by(x.supplied_usd, x.month) FROM u x WHERE x.family = k.family AND x.chain = k.chain AND x.month <= mo.month) AS supplied_usdFROM keys k CROSS JOIN months mo)SELECT s.month, s.read_day, s.protocol_family, s.base_share, s.base_share_pct, s.base_supplied_usd, s.all_chains_supplied_usd, s.ethereum_supplied_usd, s.chains_read,date_format(s.month, '%b %Y') AS month_label,max_by(CASE WHEN s.protocol_family = 'Morpho and Aave v3 together' THEN s.base_share_pct END, CASE WHEN s.protocol_family = 'Morpho and Aave v3 together' THEN s.month END) OVER () AS base_share_pct_latest_month