Query editor
/* -------------------------------------------------------------------------------------------------------------------Pendle Market TVL TrackerGoal-------Consolidate the per-chain SY balance time-series produced by query_5529983, join those balances to a daily SY USDprice feed, and return a unified cross-chain view that shows, for every Pendle market on every supported chain,both the SY balance and its USD value.dune.p_team.sy_price_daily-------To calculate the SY price, we need both the SY exchange rate and the underlying price feed.The exchange rate can be retrieved from the SY contract.sy_price_daily is our curated sy dataset, sourced from the API. It is a good enough approximation for most cases.Some expired SY APIs might lack data, so we did some extra filling.------------------------------------------------------------------------------------------------------------------- */WITH market_daily_sy_balance AS (SELECT blockchain, chain_id, market_address, sy_address, ds, sy_balance FROM "query_5529983(chain='ethereum', start_date='2022-11-23')"UNION ALLSELECT blockchain, chain_id, market_address, sy_address, ds, sy_balance FROM "query_5529983(chain='arbitrum', start_date='2023-03-07')"UNION ALLSELECT blockchain, chain_id, market_address, sy_address, ds, sy_balance FROM "query_5529983(chain='bnb', start_date='2023-06-28')"UNION ALLSELECT blockchain, chain_id, market_address, sy_address, ds, sy_balance FROM "query_5529983(chain='mantle', start_date='2024-04-01')"UNION ALLSELECT blockchain, chain_id, market_address, sy_address, ds, sy_balance FROM "query_5529983(chain='optimism', start_date='2023-08-11')"UNION ALLSELECT blockchain, chain_id, market_address, sy_address, ds, sy_balance FROM "query_5529983(chain='berachain', start_date='2025-03-24')"UNION ALLSELECT blockchain, chain_id, market_address, sy_address, ds, sy_balance FROM "query_5529983(chain='base', start_date='2024-11-22')"UNION ALLSELECT blockchain, chain_id, market_address, sy_address, ds, sy_balance FROM "query_5529983(chain='sonic', start_date='2025-02-26')"UNION ALLSELECT blockchain, chain_id, market_address, sy_address, ds, sy_balance FROM "query_5529983(chain='hyperevm', start_date='2025-04-01')"UNION ALLSELECT blockchain, chain_id, market_address, sy_address, ds, sy_balance FROM "query_5529983(chain='plasma', start_date='2025-09-30')"UNION ALLSELECT blockchain, chain_id, market_address, sy_address, ds, sy_balance FROM "query_5529983(chain='monad', start_date='2026-06-01')"UNION ALLSELECT blockchain, chain_id, market_address, sy_address, ds, sy_balance FROM "query_5529983(chain='xlayer', start_date='2026-08-06')"UNION ALL-- robinhood 4663. start_date = first market factory creation on-chain,-- 2026-09-03 09:43:59 UTC (robinhood.creation_traces).SELECT blockchain, chain_id, market_address, sy_address, ds, sy_balance FROM "query_5529983(chain='robinhood', start_date='2026-09-03')")select sb.blockchain,sb.market_address,sb.sy_address,sb.ds,sb.sy_balance,sb.sy_balance * p.close_price as sy_value_in_usdfrom market_daily_sy_balance sbleft join (select chain_id, from_hex(token_address) as token_address, ds, close_pricefrom dune.p_team.sy_price_daily) pon sb.chain_id = p.chain_id and sb.sy_address = p.token_address and sb.ds = p.ds