Query editor
-- Dune query 8178968: "[ll] Active LL vaults" · https://dune.com/queries/8178968-- Panel 27 (table) on symbiotic-liquid-lane. One row per LL vault, in display order:-- vault name, collateral asset, TVL, supported assets, LL volume, depositors, address.-- Depositors = current unique holders of the vault's share token (mint/burn/transfer reconstruction).-- Supported assets = active tokensToRedeem on the vault's adapter (2026-08-18) — the per-vault count-- behind the "Supported assets by vault" bar (8371361); both read base_ll_tokens, so they agree.-- LL volume = redemption volume via DoSwap (amount_out = vault asset paid out), mapped adapter->vault.---- SCOPE (changed 2026-08-18, user request): ALL CONFIGURED LL vaults, funded or not -- i.e. vaults with-- at least one active tokenToRedeem. This used to filter to `tvl_usd > 0 OR depositors > 0 OR-- ll_volume_usd > 0`, which hid 4 of the 8 that are deployed and configured but hold no deposits yet,-- and made this panel disagree with the supported-assets panels (8179213 / 8371361). It now uses the-- SAME scope as those two -- base_ll_tokens with is_active -- so all three agree on the vault count.-- Why the gate is needed: base_ll_adapters also carries factory adapters that were created and pointed-- at a vault but never configured (no AddTokenToRedeem/SetLimit/DoSwap). Without the gate this listed-- 11 vaults, including `0x5858b8ec…` "H Test USDC Vault" and `0xc50b21a2…` "HUSDC Vault" -- staging-- deployments that must not surface. The `excluded_vaults` list in base_ll_adapters (the team test vault-- `0xa9c672cd…`) is still inherited on top of this. The gate is now the INNER JOIN to `assets`, which-- doubles as the supported-assets count (one reference to base_ll_tokens instead of two).---- LABELS: `tokens.erc20` has no share_symbol for the 4 unfunded vaults (a share token with no holders and-- no transfers), so the label falls back to the vault's own on-chain `name` string, decoded from the-- VaultFactory create-call InitParams (name = 1st dynamic field). Preferred over the symbol because-- symbols are NOT unique -- `0xdbddc786…` and Amber's `0x9c8f48fa…` both call themselves vUSDC.-- This decode belongs in base_vaults (8128650) so every v2 panel gets it; inlined here for now.-- NB: the table viz (12172167) stores its own column order, so it was reordered to match.-- tags: [ll]-- Depends on: query_8178635 (base_ll_adapters), query_8179210 (base_ll_tokens), query_8128650-- (base_vaults), query_8128675 (base_vault_state).WITH vault_names AS ( -- on-chain vault name out of the factory's InitParamsSELECTvault,FROM_UTF8(bytearray_substring(data, 33 + name_ptr + 32,CAST(bytearray_to_uint256(bytearray_substring(data, 33 + name_ptr, 32)) AS bigint))) AS vault_labelFROM (SELECT output_entity_ AS vault, data,-- head starts at byte 33 (after the 32-byte tuple offset); word 1 = name pointerCAST(bytearray_to_uint256(bytearray_substring(data, 33, 32)) AS bigint) AS name_ptrFROM symbiotic_ethereum.vaultfactory_call_createWHERE contract_address = 0xAEb6bdd95c502390db8f52c8909F703E9Af6a346 -- VaultFactory v3AND call_success = trueAND version = 3)),assets AS ( -- active tokensToRedeem per vault: both the scope gate and the displayed countSELECT vault, COUNT(DISTINCT token) AS supported_assetsFROM query_8179210 -- base_ll_tokensWHERE is_active AND vault IS NOT NULLGROUP BY vault),ll AS (SELECT a.vault, a.asset_symbol, s.supported_assets,COALESCE(vn.vault_label, bv.share_symbol,SUBSTR(CAST(a.vault AS varchar), 1, 10) || '…') AS vault_nameFROM query_8178635 a -- base_ll_adapters (test vault already gone)JOIN assets s ON s.vault = a.vault -- gate: configured vaults onlyLEFT JOIN query_8128650 bv ON bv.vault = a.vault -- base_vaults (share_symbol)LEFT JOIN vault_names vn ON vn.vault = a.vaultWHERE a.vault IS NOT NULL),