Query editor
/*@title: Steakhouse Morpho — Chain Spreads (HY, cbBTC, WETH, wstETH), raw daily@description: Raw daily Base and Ethereum borrow rates and Base − Ethereum chain spreads for the HY USDC basketand four benchmark markets (cbBTC/USDC, WETH/USDC, wstETH/USDC, wstETH/WETH). Input for dynamic factor model.@author: Romana@notes: Raw sibling of query_8823052 (basket logic unchanged, no 7d MA).Exclusion-window dates are dropped; reindex to a full calendar downstream so they appear as missing.wstETH/WETH is WETH-denominated (ETH-funding spread) — not level-comparable to USDC spreads.@version: 1.0*/with holders (blockchain, holder, vault_label, valid_from, valid_to) as (values('base', 0xbeefa7b88064feef0cee02aaebbd95d30df3878f, 'base', date '2000-01-01', date '2026-04-13'), ('base', 0xfaaf20a032aefada97278c165345b6be1afc18c2, 'base', date '2026-04-14', date '2100-01-01'), ('ethereum', 0xbeefff209270748ddd194831b3fa287a5386f5bc, 'ethereum', date '2000-01-01', date '2026-04-22'), ('ethereum', 0xbfe734baab130048e20a64e800c4c2ec25756284, 'ethereum', date '2026-04-23', date '2100-01-01')), excluded_windows (excl_from, excl_to, reason) as (values(date '2026-03-22', date '2026-03-25', 'Resolv exploit'), (date '2026-04-18', date '2026-04-21', 'KelpDAO exploit'), (date '2026-04-01', date '2026-04-01', 'Drift exploit / whale deleveraging'), (date '2026-06-11', date '2026-06-13', 'Coinbase High Yield Edition launch')), bench_markets (asset, blockchain, market_id) as (values('cbbtc_usdc', 'base', 0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836), ('cbbtc_usdc', 'ethereum', 0x64d65c9a2d91c36d56fbc42d69e979335320169b3df63bf92789e2c8883fcc64), ('weth_usdc', 'base', 0x8793cf302b8ffd655ab97bd1c695dbd967807e8367a65cb2f4edaf1380ba1bda), ('weth_usdc', 'ethereum', 0x94b823e6bd8ea533b4e33fbc307faea0b307301bc48763acc4d4aa4def7636cd), ('wsteth_usdc', 'base', 0x13c42741a359ac4a8aa8287d2be109dcf28344484f91185f9a79bd5a805a55ae), ('wsteth_usdc', 'ethereum', 0xb323495f7e4148be5643a4ea4a8221eef163e4bccfdedc2a6f4696baacbc86cc), ('wsteth_weth', 'base', 0x3a4048c64ba1b375330d376b1ce40e4047d03b47ab4d48af484edec9fec801ba), ('wsteth_weth', 'ethereum', 0xb8fc70e82bc5bb53e773626fcc6a23f7eefa036918d7ef216ecfb1950a94a85e)), markets as (selectblockchain, market_id, loan_decimalsfrom dune.steakhouse.result_morpho_markets), flows as (selectdate(evt_block_time) as dt, holder, blockchain, market_id, sum(shares) as shares_deltafrom (select s.evt_block_time, h.holder, s.chain as blockchain, s.id as market_id, s.shares as sharesfrom morpho_blue_multichain.morphoblue_evt_supply as sjoin holders as h on s.onBehalf = h.holder and s.chain = h.blockchainunion allselect w.evt_block_time, h.holder, w.chain as blockchain, w.id as market_id, -w.shares as sharesfrom morpho_blue_multichain.morphoblue_evt_withdraw as wjoin holders as h on w.onBehalf = h.holder and w.chain = h.blockchain) as fjoin markets using (market_id, blockchain)group by 1, 2, 3, 4