Query editor
-- Dune query name: tokenized_stocks_xstocks_ethereum_aum_daily_v1-- Description: xStocks Ethereum daily AUM in USD, buccaneers-owned. Supply-- is derived from evms.erc20_transfers with mint/burn-only-- 0x5F7A issuer-wallet exclusion (matches xstocks-team q6084787-- and the ink/hyperevm/xlayer methodology).-- Token universe + per-xStock Backed mark price come from-- materialized helper query 8327052-- (dune.buccaneers.result_tokenized_stocks_backed_ethereum_snapshot_v1),-- which isolates the flaky Backed HTTP_GET calls so a Backed-- hiccup can't fail this MV; at worst yesterday's prices apply-- for one day until the helper refreshes.-- Backed's collateral.price is the tokenized-mark (per-xStock-- unit) - authoritative for the AUM question because it accounts-- for fractionation like MSTRx ~ 0.29 MSTR share.-- Fallback: oclsanti historical stock prices for 11 symbols-- Backed does not yet mark (CMCSAx, CRWDx, HOODx, IWMx, JPMx,-- MAx, MRVLx, ORCLx, QQQx, VTIx, VTx as of 2026-08-14) - per--- share not per-xStock, may slightly overstate any Backed--- fractionated fallback tokens (none material at present).-- Historical days apply today's Backed mark flat (supply-driven-- trajectory - a proper daily-price history would require-- persisting Backed snapshots into a time-series table).-- Materialize as dune.buccaneers.result_tokenized_stocks_xstocks_ethereum_aum_daily_v1-- Reference in tokenized_stocks_xstocks_chain_aum_daily_base_v1 (query 6998488).WITH backed_snapshot AS (SELECT contract_address, symbol, underlying_ticker, backed_price_usdFROM query_8327052),xstocks_ethereum_tokens AS (SELECT DISTINCT contract_address, symbol, underlying_tickerFROM backed_snapshot),xstocks_ethereum_meta AS (SELECTLOWER(CAST(contract_address AS VARCHAR)) AS contract_address,COALESCE(TRY_CAST(decimals AS INTEGER), 18) AS decimalsFROM tokens.erc20WHERE blockchain = 'ethereum'AND LOWER(CAST(contract_address AS VARCHAR)) IN (SELECT contract_address FROM xstocks_ethereum_tokens)),xstocks_ethereum_supply_deltas AS (SELECTCAST(DATE_TRUNC('day', t.evt_block_time) AS DATE) AS day,LOWER(CAST(t.contract_address AS VARCHAR)) AS contract_address,CAST(SUM(CASEWHEN LOWER(CAST(t."from" AS VARCHAR)) = '0x0000000000000000000000000000000000000000'THEN CAST(t.value AS DOUBLE) / POWER(10, COALESCE(m.decimals, 18))WHEN LOWER(CAST(t."to" AS VARCHAR)) = '0x0000000000000000000000000000000000000000'THEN -CAST(t.value AS DOUBLE) / POWER(10, COALESCE(m.decimals, 18))ELSE 0END) AS DOUBLE) AS delta_unitsFROM evms.erc20_transfers tLEFT JOIN xstocks_ethereum_meta mON LOWER(CAST(m.contract_address AS VARCHAR)) = LOWER(CAST(t.contract_address AS VARCHAR))WHERE t.blockchain = 'ethereum'