Query editor
-- indices: basket-creation events by day (StockAdded), cumulative, across both Indices treasury-- contracts discovered in docs/research/2026-08-05-indices-contracts.md (Task 2 of the INDEX-- thesis test SDD), board_decision "board9": StockTreasury-- (0x1604Ff11dFeAaC437077aEDA2FA492ac9EC804dF, deployer 0x89562Eb8979dB1E85A01E85120BFD6A7C47a39cb,-- discovered 2026-08-05) and USDGBuyerDistributorV2 (0x39ADB8acD07427D338b5f1AfAb436A04AbFdB7c4,-- same deployer, discovered 2026-08-05). Both are theindex.finance's on-chain "stock basket"-- builders: a StockAdded event fires each time a tokenized-stock ERC20 is registered into a-- contract's basket array. "Basket" here means one addStock call, not a per-user custom basket:-- this product runs exactly two shared baskets (V1 on StockTreasury, V2 on USDGBuyerDistributorV2),-- not a multi-tenant basket factory, so baskets_created_total tracks basket-construction events,-- the closest verifiable analog to the brief's "basket-creation events" for this real contract set.---- Verified live on Blockscout and in the Dune editor before writing this query: topic0 for-- StockAdded(address indexed token, uint24 fee, int24 tickSpacing, address hooks) is-- 0xa9d5de5dbe859707133f119258028e1bc0529fc5821f001509854acf735bb4a7 (keccak256 of the event-- signature, cross-checked against both contracts' verified ABIs on Blockscout and against a live-- Dune query grouping robinhood.logs by topic0, which returned exactly this hash at 18 rows on-- USDGBuyerDistributorV2 and 6 rows on StockTreasury, 2026-08-06). StockTreasury (V1, ETH--- denominated basket, deployed 2026-07-03) carries 6 StockAdded events: 5 on 2026-07-03 (initial-- basket) and 1 more on 2026-07-09. USDGBuyerDistributorV2 (V2, USDG-denominated basket, deployed-- 2026-07-28) carries 18 StockAdded events, all within an ~8-second launch window on 2026-07-28,-- resolving live to AMD, AAPL, BE, AMZN, CRWV, COIN, GOOGL, INTC, META, MSFT, MU, NVDA, PLTR,-- ORCL, SPCX, SNDK, USAR, TSLA (insertion order confirmed via row_number(), cross-checked against-- three addresses independently verified in docs/notes/robinhood-schema.md section 12: AAPL,-- SPCX, and TSLA all landed at their expected index). V1 also carries 5 StockRemoved events on-- 2026-07-09 (the same day as its 6th add), which this query does not net out, since-- baskets_created_total counts creation events, not the current live roster (see-- sql/indices_c_basket_weights.sql for the current V2 roster, the only one with a well-defined-- per-asset weight).---- Data-start caveat: this product is new. USDGBuyerDistributorV2 first_tx 2026-07-28 19:40:13 UTC;-- StockTreasury first_tx 2026-07-03 02:55:53 UTC (both from Task 2's JSON). Event coverage in this-- query starts at StockTreasury's first StockAdded (2026-07-03) and cannot predate it. Zero-count-- days are zero-filled (not skipped) so a chart renders a flat cumulative line instead of an empty-- gap, matching the house pattern in sql/index_d_sinjoh_burns_daily.sql.-- last verified 2026-08-06with events as (select block_timefrom robinhood.logswhere contract_address in (0x1604Ff11dFeAaC437077aEDA2FA492ac9EC804dF, 0x39ADB8acD07427D338b5f1AfAb436A04AbFdB7c4)and topic0 = 0xa9d5de5dbe859707133f119258028e1bc0529fc5821f001509854acf735bb4a7),daily as (select date_trunc('day', block_time) as day, count(*) as stocks_addedfrom eventsgroup by 1),day_spine as (select d as dayfrom unnest(sequence((select cast(min(day) as timestamp) from daily),cast(date_trunc('day', now()) as timestamp),interval '1' day)) as t(d))selects.day,coalesce(d.stocks_added, 0) as stocks_added,sum(coalesce(d.stocks_added, 0)) over (order by s.day rows between unbounded preceding and current row) as baskets_created_totalfrom day_spine s