Query editor
-- Symbiotic TVL — daily TVL across pre-deposit (v0) + Core v1 + Core v2.-- Depends on: query_6894040 (v0 + v1), query_8291505 (base_v2_tvl_daily — Core v2)-- Consumers: core-stats "TVL by asset" (viz 10789811) + 6 charts on tvl-stats (10789767/803/805/813/814/816).---- ⚠️ TWO TVL MODELS IN ONE SERIES SET — this is deliberate, but do not read cross-version series as-- like-for-like. v0/v1 cumulate deposit/withdraw/slash FLOWS, so they report cost basis and are-- blind to collateral appreciation. v2 reads the vault's own AccrueInterest.newTotalAssets, a NAV-- snapshot that includes yield and adapter P&L. Sound for a total; see-- specs/core-stats-v2-integration.md §2 for why.---- ⚠️ vault_version is RELABELLED FOR DISPLAY here, and must stay that way. The upstream literals are-- legacy: query_4627716 emits 'v2' meaning Core **v1**, and query_6894040 emits 'pre-deposit' for v0.-- Left raw, the public legend on "TVL by vault version" would read "pre-deposit / v2 / core-v2" —-- two different meanings of "v2" side by side. Relabel at the display layer ONLY; the bases keep-- their raw literals because other consumers match on them (see MIRROR.md, legacy data labels).WITH combined AS (SELECT dt, vault, collateral_address, whitelisted, label, symbol, TVL_token, TVL_usd, vault_versionFROM query_6894040 -- pre-deposit (v0) + Core v1UNION ALLSELECT dt, vault, collateral_address, whitelisted, label, symbol, TVL_token, TVL_usd, vault_versionFROM query_8291505 -- Core v2 (base_v2_tvl_daily)),cleaned AS (SELECT *FROM combinedWHERE TVL_usd IS NOT NULL)SELECTdt,collateral_address,vault,CASE vault_versionWHEN 'pre-deposit' THEN 'Pre-deposit (v0)'WHEN 'v2' THEN 'Core v1'WHEN 'core-v2' THEN 'Core v2'ELSE vault_versionEND AS vault_version,ANY_VALUE(symbol) AS symbol,SUM(TVL_usd) AS TVL_usd,1 AS dummy -- used for dune chartingFROM cleanedGROUP BY 1, 2, 3, 4, 7ORDER BYdt DESC,TVL_usd DESC;