ETFs
One of the app's features lets you select ETFs of any brand in the Watchlist and aggregate their holdings to see how often each ticker appears across the selected funds. Repeated holdings make overlapping exposure visible: the more selected funds include a ticker, the greater its potential influence on the portfolio; gains in that holding may help, while declines may hurt, and actual impact also depends on each fund's position size. Another feature makes it faster and easier to find funds with stronger growth over different periods, higher dividend yields or distributions, greater Total Return (price performance plus dividends), and other key performance metrics, across all brands at once: for example, sort every ETF of every brand by TR 1Y descending and build a Watchlist that mixes funds of different brands. A client-side app that reads the generated api/<slug> static feeds of the 29 sibling applications at runtime into one searchable ETF catalog with per-fund tabs, cross-brand watchlist aggregation, ticker copy and CSV/TXT export - the same look, feel, columns and business logic as the sibling applications, built with Parcel and Tailwind CSS into a static dist, with no data files and no aggregator; its only dependency is the screener core of Stocks, bundled at build time
Using Bun
bunx degit daggerok/ETFs#main ./12345 && cd $_
bun install
bun run serve
bun run serve starts the Parcel dev server (it prints the local URL, http://localhost:1234 by default). bun run build writes the static site to dist, bun run build-github-pages does the same with the /ETFs/ public URL used on GitHub Pages
The application is published at https://daggerok.github.io/ETFs/. The Pages deployment is made by .github/workflows/github-pages.yml (GitHub Actions) from main.
The degit quick start gives only the hub files, so the data is loaded from the sibling applications' GitHub Pages feeds. For fully local data, clone the hub and the sibling repositories next to it:
git clone https://github.com/daggerok/ETFs && cd ETFs
./scripts/install.sh --depth 1
bun install
bun run serve
./scripts/install.sh clones the 29 sibling repositories into subfolders of the hub folder (they are ignored by the hub's .gitignore):
- no arguments clones all of them with full history;
--depth 1 (-d 1) is the fastest and smallest way to just run the app
- repositories can be listed positionally, separated by spaces and/or commas, case-insensitive:
./scripts/install.sh VanEck Tema or ./scripts/install.sh VanEck,Tema
-s / --ssh clones over SSH instead of HTTPS, -p N / --parallel N sets the parallel clones (default 1), -h / --help prints the usage
./scripts/update.sh fetches (with prune and tags) and fast-forwards main (or master) of every cloned repository to get fresh data. It switches every repository to that branch first: a clone sitting on a feature branch is moved off it (the checkout fails instead of overwriting when uncommitted changes conflict), so commit or stash work in progress before running it. It takes the same style of arguments: no arguments updates every cloned repository, repositories can be listed positionally (./scripts/update.sh VanEck Tema or VanEck,Tema), -p N / --parallel N sets how many are updated in parallel (default 1) and -h / --help prints the usage. Git output streams live (with several parallel jobs each repository's block is printed as soon as it finishes) and the exit code is non-zero if any repository failed. All the scripts resolve the hub root from their own location, so they work from any working directory. Every cloned repository stays an independent git repository, so you can develop, commit and open pull requests in any of them separately.
./scripts/update-data.sh refreshes the data of the cloned repositories, up to 3 at a time, with each repository's own updater, then commits and pushes it the way its update-data.yml workflow does: pull main fast-forward, bun install --frozen-lockfile, ./scripts/update-data.ts, git add api/<feed>, commit chore(data): update <Brand> ETF data, push (when main moved meanwhile it rebases the data commit and retries). The feed folder and the commit message are read from the repository's workflow. A repository that is not on main or has uncommitted changes outside its feed folder is skipped and reported, never touched; uncommitted changes inside the feed folder only are the leftover of an interrupted run and are discarded before the pull, since the updater regenerates them. Repositories can be listed like for the other scripts (./scripts/update-data.sh VanEck Tema), --no-push commits without pushing, and update controls are environment variables passed to every updater (REQUEST_SLEEP=1 ./scripts/update-data.sh VanEck). The output streams live. A summary lists every repository at the end, a failed one with its reason (not on main, uncommitted changes, a failed pull, push or update-data.ts exit code), every repository and the whole run show when they started and finished and how long they took (OK SPDR: committed 1a2b3c4, pushed (10:02:11 -> 10:21:09, 18m58s)), and the exit code is non-zero if any failed. Every run is saved in logs/update-data/<date>_<time>/ (gitignored, the last 30 runs are kept): <repo>.log with the whole output of each repository and summary.log; the summary line of a failed repository names its log. -p N (--parallel N, -j N, --jobs N, default 3) updates up to N repositories at the same time and every output line then starts with [<repo>]; -p 1 goes one after another in plain sections, like a run of a single repository; keep N at 3-4, the repositories share the SEC and Yahoo rate limits of your IP. --help lists every option. The same script is scripts/update-data.sh of the investments repository, which also updates and publishes Stocks. Useful where a provider blocks GitHub's runners, since the data comes from your own connection.
./scripts/clean.sh removes the cloned sibling repositories again (all of them, or only the listed ones: ./scripts/clean.sh VanEck Tema or VanEck,Tema; -p N / --parallel N, default 1). A repository with uncommitted changes, ignored files, unpushed commits, a detached-HEAD commit or stash entries is never removed, and neither is one on which git itself fails (a broken clone is reported, not deleted): it is kept with a message, so no work is lost. A repository listed twice is handled once. Only the known ETF repositories are touched, never the hub files.
./scripts/install.sh first checks that git is installed (it fails if it is not), installs bun with the official script when bun is missing, runs bun i -E for the hub packages and then clones the repositories.
Data sources
Each brand repository publishes the standard feed api/<slug>/index.json plus per-fund funds/<TICKER>/meta.json, holdings/NNN.json and history/NNN.json pages; the hub only reads them. The base URL of every brand is chosen like this:
| Situation |
Base URL |
location.hostname ends with github.io |
https://daggerok.github.io/<Repo>/api/<slug>/ |
anything else, such as local bun run serve |
./<Repo>/api/<slug>/, the sibling folder next to the hub; when that brand's index.json is missing or fails (for example after degit, where no sibling folders exist) the brand is retried from https://daggerok.github.io/<Repo>/api/<slug>/, and that base is then used for the brand's per-fund files too; such brands get a small remote badge in the brand filter |
?api=remote |
always https://daggerok.github.io/<Repo>/api/<slug>/, so local development can test production data |
?api=local |
strictly ./<Repo>/api/<slug>/, no fallback |
GitHub Pages serves every site with access-control-allow-origin: *, so reading the feeds from the hub or from localhost needs no proxy. The feeds themselves come from the issuers' public pages, SEC EDGAR and Yahoo Finance.
How it works:
- Startup: the 29 brand indexes are fetched in parallel by a pool of 8 workers with a progress counter; a brand that fails (404, network, 25 s timeout) is marked unavailable with a small badge and everything else keeps working
- Cache: every brand index is stored in IndexedDB keyed by origin, api mode and repo together with its
generatedAt, and revalidated with fetch(url, { cache: 'no-cache' }); the first paint comes from the cache when one exists. Every storage access is wrapped in try/catch
- Memory: rows are normalized once into Float64Arrays for the sortable numerics (NaN means unavailable) and small integer dictionaries for brand, category and returns basis, so about 2,500 funds sort and filter in a few milliseconds; the DOM is windowed (200 rows, more are appended while you scroll)
- Sorting: the catalog starts sorted by Net Assets, largest first; unavailable values always sort last, in both directions, and are shown as a dash, never as
0
- Filters: search (words are ANDed across ticker, name, brand, category, returns basis and exchange;
brand:vaneck, category:"fixed income", ticker:spy, basis:official target one field; typing a brand or category also suggests it, and picking a suggestion edits the same selection as the dropdowns), brand and category multi-selects (search, All, Clear, Toggle, Reset, per-row Only; bulk actions act on the rows shown, the selection accumulates across searches) and Hide stale returns (older than N days), which hides funds whose performanceAsOf is older than N days (default 45) or unknown; it is off by default
- Source badge: each row shows
metrics.returnsBasis as a badge (NAV official, mixed official with derived gaps, derived computed from price or NAV history, n/a) and performanceAsOf as Return As Of
- Yield Basis column (right after SEC Yield): a short badge for
metrics.dividendYieldBasis (12M official trailing 12-month, DIST official distribution rate, OFFC official other definition, CALC computed trailing 12-month, IND indicated); hovering the badge or the Dividend Yield value shows the full label, a dash and Basis not in the feed yet mean the feed does not carry the key. The column sorts, filters as text (the label, e.g. trailing) and is exported as the label
- Watchlist: Use checkboxes (persisted in
localStorage per brand and ticker) select funds across brands; their holdings pages are loaded on demand from each fund's own brand base and aggregated by security: CUSIP, ISIN, FIGI or SEDOL, else ticker and name, never by ticker alone (Vanguard T on Treasuries is not AT&T); a closed fund keeps its row with a Closed <date> badge that links the closing notice; detail tabs (Overview, Holdings, History, Distributions) load on demand the same way
ETF screener
The panel above the table is the screener of the Stocks app, limited to ETFs: presets as chips with the number of funds that pass each one, All of or Any of for the chosen main presets, the dashed and chips (refinements) that always narrow further, ¬ to exclude a preset, and ▾ to open its conditions with the funnel (how many funds are left after each condition). The table shows only the funds that pass the chosen chips; the search, Brands, Categories, the stale toggle, the blacklist and the column filters apply on top, and the status line of the panel says how many of all ETFs pass. The presets are the ones that apply to ETFs: Gold, Stable growth (horizon 1Y to 10Y on the chip), Volatile swings, Pays a dividend, Up over 1 year and Dividend growth. Mine is left out because it needs the owner's list from the Stocks feed, and the stock-only presets (earnings, cash flow, debt) cannot match a fund
Benchmark screeners and ETF on sale (benchmark plan stage 2, hub plan H5): the chips Beats the benchmark, Steady income, High income no erosion, Monthly grower, Price growth, Rotation: lagging now, Best in sector and ETF on sale, and the refinements and Index family, and Yield above the benchmark, and Pullback, and Monthly payments, and Qualified dividends, and AUM from and and Costs up to. A chip carries its own selects (pickers): Benchmark SPY or QQQ, Horizon, Return, Yield from, Risk, Sector, Family, Depth or a level; the choice changes the chip's conditions and count and is remembered (etfs-screener-pickers, reset by the Clear item "Screener chip choices"). They read the benchmark metrics of the brand feeds (vsSpy5y, maxDrawdown5y, beta1ySpy, relStrength3mSpy, stressReturnSpy, perf5y, payFrequency and the rest, published by the shared benchmark and dividends blocks): a brand whose feed does not carry them yet shows no matches on those chips until its next data refresh. ETF on sale finds strong funds that are cheap now: at least 10% below the 52-week high, a CAGR of 10% a year or more on the horizon (10Y by default, a fund of 5 to 10 years is judged on 5Y), not behind SPY or QQQ over it, a drawdown no deeper than 35%, $1B of assets or more, no leveraged or inverse funds; add «and Pays a dividend» or «and Dividend growth» for income. The line under the head row is the market state: SPY and QQQ distance from their all-time high close with at the high, pullback, correction or bear market, from the SPY and QQQ rows of the feeds; Rotation: lagging now is meant for a market near its high. The page also loads etf-classes.json and qdi.json of the Stocks core (copied to dist at build): leveraged and inverse funds (isGeared