Query editor
-- [v0] Symb Vaults TVL · https://dune.com/queries/4572092-- OPTIMIZED 2026-07-30: query_4571755 scanned ONCE (conditional agg) instead of twice; HAVING keeps deposit-- vaults. Verified byte-identical (19 rows). Depends on query_4571755, query_4627759.WITH agg AS (SELECTvault, symbol, erc20,SUM(CASE WHEN action = 'deposit' THEN amount END) AS total_deposited,COUNT(DISTINCT CASE WHEN action = 'deposit' THEN actor END) AS uniq_depositors,COALESCE(SUM(CASE WHEN action = 'withdraw' THEN amount END), 0) AS total_withdrawnFROM query_4571755 -- [v0] ! Symbiotic All actionsGROUP BY vault, symbol, erc20HAVING SUM(CASE WHEN action = 'deposit' THEN 1 ELSE 0 END) > 0),tvl AS (SELECTvault, symbol, erc20, total_deposited, total_withdrawn,total_deposited - total_withdrawn AS vault_tvl,uniq_depositorsFROM agg)SELECTtvl.vault,tvl.symbol,ROUND(p.price * vault_tvl, 0) AS tvl_usd,tvl.uniq_depositors AS vault_depositors,tvl.erc20FROM tvlLEFT JOIN query_4627759 AS p -- [utils] Symbiotic latest pricesON p.contract_address = tvl.erc20ORDER BY tvl_usd DESC