Query editor
-- Query: Vaults Total Yields-- Dune: https://dune.com/queries/6290284-- Version: 38-- (v37) Added EURe Yield (Arb) and YO Ecosystem. Same AccrueInterest maths, but read from-- the decoded morpho_v2_multichain.vaultv2_evt_accrueinterest (which does index our V2-- vaults) instead of raw logs: reading arbitrum.logs/ethereum.logs for these two doubled-- the query's cost (4.0 -> 8.3 credits) for ~$50 of interest. Floored at each vault's-- creation date (2026-09-22, 2026-10-06). EURe is priced from prices.usd_latest: Arbitrum EURe-- 0x0c06cCF38114ddfc35e07427B9424adcca9F44F8 first, Ethereum EURe as the fallback.-- wARS Yield (Arc) is left out: no markets, so no interest yet.-- (v35) Added USDC Yield Base -- first vault on Base, sourced from base.logs-- (same AccrueInterest technique, new chain). USDC prices fine via the-- existing prices.usd_latest join, no workaround needed. Vault has ~$1-- total_assets right now (one seed transfer, no real deposits), so its-- contribution here is negligible by construction, not a bug.-- V2 yield source: morpho_multichain.vaultv2_* spell tables do NOT index our-- V2 vault contracts. Instead we decode AccrueInterest events directly from-- ethereum.logs / arbitrum.logs.-- AccrueInterest topic0:-- 0x4dec04e750ca11537cabcd8a9eab06494de08da3735bc8871cd41250e190bc04-- Data layout: [previousTotalAssets 32B][newTotalAssets 32B][perfFeeShares 32B][mgmtFeeShares 32B]-- Interest per event = newTotalAssets - previousTotalAssets-- (v34) Added wARS Yield (V2-only, launched 2026-07). Its underlying, wARS-- (0x0DC4F92879B7670e5f4e4e6e3c801D229129D90D, 18 decimals), has NO feed in-- prices.usd / prices.usd_latest -- confirmed zero rows both ways. It IS-- actively traded on Uniswap (455k+ trades since 2026-01-01), so `wars_price`-- below derives a volume-weighted USD price from a trailing 7-day dex.trades-- window instead (mirrors what prices.usd_latest represents for every other-- vault: a current, not historical-average, price). Without this the vault's-- underlying-yield figure would still be correct, but its USD contribution ---- and therefore kpk_total_yield_usd -- would silently price it at zero.WITH vaults AS (-- V1 vault addresses (V1 interest: inception → migration date)SELECT vault_addressFROM (VALUES(0xe108fbc04852B5df72f9E44d7C29F47e7A993aDd), -- USDC Prime(0x0c6aec603d48eBf1cECc7b247a2c3DA08b398DC1), -- EURC Yield(0xd564F765F9aD3E7d2d6cA782100795a885e8e7C8), -- ETH Prime(0x2c609d9cfc9dda2db5c128b2a665d921ec53579d), -- USDC Yield (Arbitrum)(0x9178eBE0691593184c1D785a864B62a326cc3509), -- USDC Yield(0xc88eFFD6e74D55c78290892809955463468E982A), -- ETH Yield(0xdaD4e51d64c3B65A9d27aD9F3185B09449712065) -- USDT Prime) AS t(vault_address)),underlyings AS (SELECTv.vault_address,CASEWHEN v.vault_address IN (0xe108fbc04852B5df72f9E44d7C29F47e7A993aDd, 0x9178eBE0691593184c1D785a864B62a326cc3509)THEN 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 -- USDC (Ethereum)WHEN v.vault_address IN (0xd564F765F9aD3E7d2d6cA782100795a885e8e7C8, 0xc88eFFD6e74D55c78290892809955463468E982A)THEN 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 -- WETH (Ethereum)WHEN v.vault_address = 0x0c6aec603d48eBf1cECc7b247a2c3DA08b398DC1 THEN 0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c -- EURC (Ethereum)