Query editor
-- Monthly snapshot snail-chart source for Morpho/Base-- Each row = one monthly snapshot with all 6 metrics in $USD---- Methodology notes:-- - Borrow side uses the markets table (result_morpho_interactions_multichain_all_chains).-- - "All lender TVL" uses the same markets table (supply_amount_usd) — Morpho's-- official methodology, see query_5127446 (Total supply USD per chain on-- https://dune.com/morpho/gmorpho-dashboard). This captures both vault-mediated-- supply (vault.supply() -> market) and direct-to-market lenders.-- - "CB lender TVL" stays on the vaults table because that's the only source-- with Coinbase-user attribution (smart-wallet-factory + Coinbase-only vault).WITH month_starts AS (SELECT month_startFROM UNNEST(SEQUENCE(DATE '2025-01-01',DATE_TRUNC('month', CURRENT_DATE),INTERVAL '1' MONTH)) AS t(month_start)),months AS (SELECTCASEWHEN month_start = DATE_TRUNC('month', CURRENT_DATE) THEN CURRENT_DATEELSE CAST(month_start + INTERVAL '1' MONTH AS DATE) - INTERVAL '1' DAYEND AS snapshot_date,CASEWHEN month_start = DATE_TRUNC('month', CURRENT_DATE) THEN CAST(CURRENT_DATE + INTERVAL '1' DAY AS TIMESTAMP)ELSE CAST(CAST(month_start + INTERVAL '1' MONTH AS DATE) AS TIMESTAMP)END AS snapshot_cutoff_tsFROM month_starts),cb_markets AS (SELECT chain, market_idFROM query_7437221 -- Coinbase Markets (8 USDC-borrow markets on Base)),-- BORROW SIDE — Coinbase markets only, USDC debtcb_users_borrow_events AS (SELECT i.time, i.collat_amount_usd, i.borrow_amount_usdFROM dune.morpho.result_coinbase_onchain_interactions iJOIN cb_markets cbm ON cbm.chain = i.blockchain AND cbm.market_id = i.idWHERE i.blockchain = 'base'),all_users_borrow_events AS (SELECT i.time, i.collat_amount_usd, i.borrow_amount_usdFROM dune.morpho.result_morpho_interactions_multichain_all_chains iJOIN cb_markets cbm ON cbm.chain = i.blockchain AND cbm.market_id = i.idWHERE i.blockchain = 'base'),-- LEND SIDE-- Coinbase lenders: vaults table (encodes Coinbase smart-wallet-factory +-- Coinbase-only-vault identification).cb_lender_events AS (SELECT v.time, v.supply_amount_usdFROM dune.morpho.result_coinbase_onchain_vaults_interactions vWHERE v.blockchain = 'base'AND v.loan_symbol = 'USDC'),