Query editor
-- Metronome Recovery Dashboard: Executive Summary Composite (Section 1)-- One row, one column per KPI card. Sources:-- * circulating supply / Morpho debt: on-chain, live (query_8222787, query_8222771)-- * legacy CDP debt: live, external feed (query_8223045 -- see its header comment)-- * ETH price / treasury NAV / buyback USD: Estimated (price-feed conversion)-- * TVL: Estimated, synth-side liquidity only (query_8223049)-- Total Debt(synth) = Morpho Debt(synth) + Legacy CDP Debt(synth). This is the one place in-- the dashboard where the historical Morpho-only view (Section 2) and the current-day legacy-- CDP addendum are combined into a single "true current" figure.-- Color thresholds (tunable by editing the CASE statements below):-- Backing %: Green >= 98%, Yellow 90-98%, Red < 90%-- Deficit: Green < 10% of the post-mortem's 7/30/2026 baseline deficit, Yellow < 50%,-- Red >= 50% of baseline (baseline = ~4.57M msUSD + ~6,367 msETH, priced at-- ETH's spot price on 2026-07-30 for the msETH leg, per the post-mortem at-- https://paragraph.com/@metronomedao/post-mortem-msethmsusd-underbacking)-- *_pct100 columns are the backing ratios x100, provided purely so the Exec Summary counter-- visualizations can display "79.6" + "%" suffix without a client-side transform.WITH latest_day AS (SELECT MAX(day) AS d FROM query_8222787),circ AS (SELECT synth, circulating_supply FROM query_8222787 WHERE day = (SELECT d FROM latest_day)),morpho_debt AS (SELECT synth, debt FROM query_8222771 WHERE day = (SELECT d FROM latest_day)),cdp AS (SELECT synth, cdp_debt FROM query_8223045),combined AS (SELECT c.synth, c.circulating_supply, COALESCE(m.debt, 0) + COALESCE(cd.cdp_debt, 0) AS total_debtFROM circ cLEFT JOIN morpho_debt m ON m.synth = c.synthLEFT JOIN cdp cd ON cd.synth = c.synth),msusd AS (SELECT circulating_supply, total_debt, circulating_supply - total_debt AS underbacking, total_debt / circulating_supply AS backing_pctFROM combined WHERE synth = 'msUSD'),mseth AS (SELECT circulating_supply, total_debt, circulating_supply - total_debt AS underbacking, total_debt / circulating_supply AS backing_pctFROM combined WHERE synth = 'msETH'),eth_price AS (SELECT price_usd FROM dune.matthomas.result_daily_pricesWHERE chain = 'ethereum' AND label = 'ETH' ORDER BY day DESC LIMIT 1),eth_price_baseline AS (SELECT price_usd FROM dune.matthomas.result_daily_pricesWHERE chain = 'ethereum' AND label = 'ETH' AND day = DATE '2026-07-30'),nav AS (SELECT nav_usd FROM query_8222908 ORDER BY day DESC LIMIT 1),burn_24h AS (SELECT COALESCE(SUM(daily_amount), 0) AS v FROM query_8223020WHERE day = (SELECT d FROM latest_day) AND synth = 'msUSD'),buyback_24h AS (SELECT COALESCE(SUM(tp.amount_acquired * pr.price_usd), 0) AS vFROM query_8222963 tpLEFT JOIN (SELECT day, label, AVG(price_usd) AS price_usd FROM dune.matthomas.result_daily_prices GROUP BY 1, 2) prON pr.day = tp.day AND pr.label = tp.assetWHERE tp.day = (SELECT d FROM latest_day)),tvl AS (SELECT COALESCE(SUM(held_usd), 0) AS v FROM query_8223049),kpis AS (SELECT(SELECT d FROM latest_day) AS as_of_day,m.underbacking AS msusd_underbacking,