Your accounts in your own viewer and your own Google Sheet: Fidelity today (the pages Fidelity Summary, Fidelity Positions and Fidelity Activity), other sources later. The project was named fidelity-accounts until 0.1.43: the old address https://daggerok.github.io/fidelity-accounts/ is gone, install the script again from the link below (it installs over the old one and keeps its storage; only the π login is saved once more). A Tampermonkey script reads the Positions page in your logged-in browser, read only, and the viewer on GitHub Pages shows it: accounts as tabs, a Summary of cards and a Positions table. No server, no Fidelity API, no secrets in code, $0. Not affiliated with Fidelity
Live: https://daggerok.github.io/accounts/
Script: https://daggerok.github.io/accounts/accounts-sync.user.js
βοΈ Settings slide down from the navbar by themselves while something needs setup: Get started sits on top, expanded, and lists only the open steps; Enter or β slides the panel up. Google Sheets is part of Get started. Once everything is set, π leaves the navbar and Get started stays squashed on top of Settings (click its header to open it):
- Google OAuth Client ID: in console.cloud.google.com enable the Google Sheets API, set the OAuth consent screen to External with your email under Test users, create an OAuth client ID of type Web application with the authorized JavaScript origin
https://daggerok.github.io(andhttp://localhost:1237for local work). An OAuth client you already use for another web app works too (add the origin to it). Paste the Client ID into Get started in the βοΈ panel - Connect Google: pick your account once, later the page connects by itself. With your own client in Testing mode Google shows "Google hasn't verified this app": press Advanced, then Go to (your app's name), and allow the Sheets access
- Google Sheet: press Create a spreadsheet, or paste the link of your own. The script writes only to the spreadsheet allowed on its corner panel on Fidelity: a new one asks there once (Allow, or Keep the current one), and the viewer shows a red line until you answer
- Install Tampermonkey. In Chrome open its extension details, turn on Allow User Scripts and allow the sites
digital.fidelity.comanddaggerok.github.io. Open the script link above, press Install, reload the viewer - Optional: in βοΈ Settings, sections Fidelity and ADP 401k, save each login. The script then logs in by itself when a site asks; a one-time code you type yourself
- Press π in the navbar: Fidelity opens on Positions, the script reads it and writes the sheet, the viewer reads it from there. While π is on, every 10 minutes at any hour the Fidelity tab reads Positions and the numbers in the viewer follow the market; opening or reloading a Fidelity page never jumps or refreshes by itself; press π again to stop. For fresh numbers right now reload the viewer (Cmd+R): the Fidelity tab reads Positions, writes what changed to the sheet, and the viewer reads it in a few seconds. When the Fidelity tab shows another page (Summary, Activity), the script opens Positions, reads it and goes back to that page; when it already shows Positions, it presses the page's Refresh Positions and reads
Once Google is connected the data comes by itself: from the sheet, or with π started for you when the sheet is empty and you never switched π yourself. π stays as you set it (in the viewer or on the script panel on Fidelity, whose dot is green while watching and grey when not); nothing pauses it by the clock. The Google sign-in is kept until it expires (about an hour), so a reload needs no click; βοΈ shows in the navbar only while Google is not connected, Disconnect is in βοΈ. On another computer: Connect Google and the data loads from the sheet, no script needed.
One way: Fidelity -> your Google Sheet -> the viewer. The viewer only asks for a read and only reads the sheet
viewer: Cmd+R or π Fidelity tab (userscript) Google Sheet viewer
asks for a read -----------> reads Positions, the daily ------> fidelity_* tabs ----> reads the sets
(Tampermonkey storage) values, transactions; writes fidelity_updates that changed
only what changed, then signals -------------------------> (signal: at once,
else every 10 min)
- The Positions page keeps Fidelity's own answer (about 100 fields per position) in its grid. A tiny reader in the page copies those rows, no extra request is sent. It reads once when Positions opens and when you press β¬ on the corner panel; with π on it reads Positions every 10 minutes while the market is open (on Positions with the page's own Refresh Positions button, from another page with a trip to Positions and back) and writes the changes to the sheet at most every 10 minutes (at once when you asked)
- The account list on the left gives the groups (Investment, Retirement) and balances. Under the navbar a panel of the same look holds the page tabs (Fidelity Summary, Fidelity Positions, Fidelity Activity; on a narrow screen the row scrolls sideways) on the left and the time of our last read (As of) on the right. In the viewer the accounts strip sits in the navbar (All accounts on the left, the rest scrolls sideways with βΉ βΊ) and shows accounts as solid chips and groups as outlined ones, names only (the numbers are on the Balance card), in the middle between the logo and the buttons while they all fit; a click on All accounts or a group folds or unfolds it, a click on an account shows only it, and the checkboxes choose any set (All accounts ticks or clears every account, a group its own accounts)
- Summary cards, titled in the green of the logo: the first one is named after what is shown (All accounts, a group, or the chosen accounts joined by +; the time of our last read sits on the right of the tabs as "As of"), movers by % or $ (the biggest loser at the very bottom), accounts sorted by value or by today's or total P&L in $ or %, upcoming dividends with the expected payout for the shares held (ex-dates until the end of the month by default, MTD, 1M, QTD or 1Q on the right; β€’ adds the DRIP of each, per account, summed over the accounts still short, with the total to buy), tickers near a 52-week high in green and near a low in red; β€’ on a card opens its full view big
- Positions table: our own columns first, then Fidelity's (every column of Fidelity's own view is there: quote data, fundamentals, returns, expense ratios and more; the ones beyond your view start hidden, turn them on in the columns window). DRIP and DRIP $: how many shares, or dollars at the last price, to buy so the next dividend of that position buys at least 0.001 share by DRIP (Fidelity reinvests to 3 decimals). A plus is what to buy (rounded up, so it is enough), a minus in green means the next payout already buys 0.001 share or more. Example: DRIP +0.012 and DRIP $ +$5.23 = buy 0.012 shares or $5.23 of them. Min. DRIP and Min. DRIP $ (hidden at first): the fewest shares, or their dollars, to hold so the next dividend buys 0.001 share, the same in every account. Adj. DRIP $ and Adj. min. DRIP $ (hidden at first): the same dollars as an order Fidelity takes, so an amount under $1 shows as $1. The sliders icon in the Symbol header opens the columns window: all columns by group with a filter on the left, the chosen ones in order on the right, moved by β‘ (mouse, finger or arrow keys); changes show at once, Default brings the default columns back
- Activity: the dividends and the interest of the shown accounts, one line a payment with what it bought by DRIP beside it (shares, price, dollars) or "no DRIP: left as cash"; today's lines are bold; periods 1M, 3M, YTD, 1Y, All; the totals follow the filters. Other kinds of activity come later
- Qualified or not, never empty: Activity has a Qualified column (with a pick list) that says Qualified, Non-qualified, Tax-free (a Roth or HSA account), Tax-deferred (another retirement account), Pending, Interest or No data, and the qualified and non-qualified dollars of the lines found in the taxable accounts; on Summary a ticker of Upcoming dividends says the same by its payments ("qualified 2 of 3" for a mix) and Income says the qualified dollars of the year; Positions has the Qualified column
- The merge icon right after the Positions tab (with more than one account shown) turns the Positions table into one line per ticker over the shown accounts: shares, value, gains, cost, income, DRIP and DRIP $ summed, Today's %, Total %, average cost and % of account worked out again over them, quotes and dividend data as they are; click it again for one block per account
- Every table sorts and filters by column, Positions and the β€’ tables of the cards alike (the table engine of the investments apps). A column knows its type from what it shows: text, number, %, $, date or payment frequency; the small badge next to its name tells which, a click on it sets the next type, Shift+click returns the detected one. A click on a name sorts: text from A to Z first, the rest largest first, payment frequency by payments a year (Monthly, Quarterly, Semi-annually, Annually), empty cells always last
- Under every name sits its filter: a space is AND, a comma is OR,
!is NOT,?is empty. Text:energy, !tech,"real estate". Numbers, % and $:>10 <50,10..50,>1B. Dates:>2026-12-01,>Dec-01-2026,2026-12(the whole month),today..,-30d... Frequency:monthly,>=quarterly,>=4. It applies as you stop typing or on Enter; β or Esc clears one, Clear next to Symbol clears all. The Symbol filter searches the symbol and the name, the number in it counts the positions left; an account with none left is not shown. Positions filters and types are remembered - Every 6 hours (no market hours or weekdays in the timing), the script also reads Fidelity's own daily account values (the data of its Summary balance chart): since each account opened the first time, then the last month. The Balance card draws them for the chosen accounts with periods from 1D to 3Y (the card shows the main ones, the big chart every step: 1D..3D, WTD, 1W..3W, MTD, 1M..11M, QTD, 1Q..3Q, YTD, 1Y..3Y); β€’ grows the card into a big window, β, a click outside or Esc shrinks it back. The change shown is the balance change (deposits are in it), not a return
- Right after that it reads the transactions history of every account (the same read the Activity page makes): the first time month by month since the account's first daily value, then the last 10 days again. That read runs every 6 hours; with π on it also reads yesterday and today every 10 minutes and writes the sheet only when something new came. A read missed because the Fidelity tab was closed runs when a Fidelity page opens next. The Income card shows the dividends and interest really received this year, quarter and month next to the plan (received plus what still comes at today's holdings) with a progress bar; until the history is read it shows --
- After the transactions, every 6 hours, Fidelity's tax info of every account (the read its Tax Info YTD page makes): which dividend payments are qualified and which are not. The current year is read with every read (its numbers are preliminary until the 1099), an earlier year once. The mark is put on the dividend transaction of the same account, day and CUSIP and written to the
qualifiedcolumn offidelity_transactions. The first time after an update to 0.1.42 or later the transactions of every account are read once more from their first day, to get each security's CUSIP - Along with those reads (every hour, and after each read of Positions, never twice within 5 minutes), Fidelity's Tax Info YTD summary of the taxable accounts (the read its Tax Info YTD page makes; Roth and other retirement accounts get no 1099): every box of the year's 1099-DIV, 1099-INT, 1099-MISC and 1099-OID so far, the margin interest paid and the realized short and long term gain or loss, written to
fidelity_tax_summary. From January 1 to April 15 the year before is read too. A box with a text instead of a number (Various, N/A) is left out, a zero is kept - Then, once a day, the beta of every holding, all read only from Fidelity and measured against the S&P 500 the way Fidelity defines beta: stocks from its stock screener (5Y beta, else 3Y, else 1Y); ETFs, mutual funds and everything else computed by the script from Fidelity's own price history: total monthly returns against SPY over the last 36 months (at least 12), daily over the last year when the history is shorter. Only a fund too young for both gets the ETF screener's 3Y beta, which is Morningstar's and may be measured against the fund's category index rather than the S&P 500 (marked ETFs 3Y). Cash is 0. The Accounts card shows each account's beta on the right as 1.17Ξ²: the average of its positions' betas weighted by their value. When some positions have no beta (bonds and CDs by CUSIP, options) the share of the value that has one shows under it in grey, for example 62%. A click on the beta opens the breakdown: every position with its value, weight, beta, source, date and contribution (the contributions add up to the account's beta), the ones without a beta last
- The ADP 401k (since 0.1.45): on a mykplan.adp.com page you are logged in to, the script reads the Transaction History month by month (a query form, read only; about 2 minutes the first time, then the last two months at most once an hour, β¬ on its panel reads at once) and writes every row to the
adp_mykplan_transactionstab of the same spreadsheet. - The script's panel on Fidelity and mykplan (since 0.1.52): one line with its name and the buttons π (a slowly blinking blue dot while watching, the same switch as in the viewer; on mykplan an open tab reads the history again every hour; switched on in the viewer it opens Fidelity, and the script opens mykplan in a background tab when none is open), {} downloads the read data as JSON, π notifications. It opens minimized to a round icon; a click on it, or βοΈ Settings -> User preferences in the viewer, opens it for every page and tab, and a question that waits (a spreadsheet to allow) shows "!" on the icon. A reload of the viewer asks an open mykplan tab to read the new days (at most every 10 minutes); if its session ended, mykplan opens again, signs in with the saved login and reads on. A settings export carries π, π and the panel switch, an import hands them back to the script
- Logins (since 0.1.48, set up in the viewer only): βοΈ Settings has a section for Fidelity and one for the ADP 401k, each with its saved login and a button that opens the site; a section without a saved login is open, a confirmed Save folds it. Save hands the login to the script once; it is kept only in the script's Tampermonkey storage, apart for each site, and the viewer keeps nothing of it (it shows only "saved" and a masked user name). The script's panel on Fidelity and mykplan only says whether a login is saved. When a session ends during a read, the script opens the site again, types the saved login on its sign-in page (once per 30 minutes, never after a refused password, a one-time code is yours to type) and the read goes on
- ADP Summary (since 0.1.55): the 401k balance on the last price day with its chart (the end of every month read and that day, the periods of the Fidelity chart), the total gain or loss against all contributions, contributions by source and dividends and earnings with MTD QTD YTD 1Y All chips (several at once, each card its own), the fund held with its units, unit price, value and its official documents, Tax allocation (Roth tax-free, pre-tax and employer tax-deferred) and Fund allocation as a donut or bars. On a wide screen the chart takes two thirds of the page and its full height, the other cards stand one below another at the right. The script keeps the month-end balances in
adp_mykplan_balances_monthly; the first read after the update reads the whole history once more to get them - Fidelity Reports (since 0.1.77): Watchlist, Investments, Dividends, DRIPs. Watchlist: every ticker of the accounts chosen in the navbar once, the largest market cap first (the cash core and SGOV left out, as in fidelity-reports), All, ETFs or Stocks; β¬ Export gives a text file with one ticker a line (a brokerage's watchlist import), a TradingView list (
###nameand the tickers comma separated, for Import list in TradingView), a CSV (Symbol, Name, Market cap, Type, Accounts) or the tickers in the clipboard. No files to load: it is built from the positions the viewer already has. The report is picked in the menu right before β¬ Export; every report has ETFs and Stocks chips and Qualified and Ordinary chips (both on or both off: every security; the likely ones count), each report keeps its own. Investments: a table an account, how much more to put in so a position costs $2, $3 ... $100 in all, in dollars and in shares to buy; CSV with an Account column. Dividends: a table an account, how much more to put in so one payment buys 0.001 share (1x), 2x, 3x ... as many, in dollars and in shares to buy, the report of fidelity-reports; β¬ Export gives one CSV with an Account column first. DRIPs: a table an account, the positions whose next dividend does not buy 0.001 share yet, the most payments a year first: the minimal value for a DRIP, the money and shares still needed, the next ex and pay dates; CSV with an Account column. Positions has our column Fundamentals: a stock's β opens its ticker page of the Stocks app in a window over Positions, with a link to the same page on https://daggerok.github.io/investments/ in a new tab; an ETF's or a fund's β is dimmed until the ETFs hub has a ticker page - ADP Activity: the page shows once the 401k history is in the sheet: every row since the plan began (date, paycheck, type, source, fund, units, price, amount), sorted and filtered like the other tables, periods 1M, 3M, YTD, 1Y, All; the totals of the rows found: my contributions (Roth and pre-tax), the employer's, dividends and earnings
- π Notifications (off by default; βοΈ User preferences in the viewer or π on the Fidelity panel, one switch): when on, the script gives one notification each time it finishes a job (a sync, the daily values, the transactions, the betas, the 401k history) or hits an error, as a popup inside the viewer only (no browser notifications). The popup is in the palette's color for a success (closes by itself), red for an error (stays until β)
- Only the Fidelity tab writes the sheet, with the Google token the viewer hands over, and only the data sets that changed: summary (accounts and daily balances), positions, transactions, betas. Then it marks them in
fidelity_updatesand signals the viewer, which reads just those sets back. No signal (another computer, no script): the viewer checksfidelity_updatesevery 10 minutes and whenever its tab comes back into view. Without a token the writes wait until the viewer is open and connected - βοΈ Settings -> User preferences: theme, language, π and π as icon buttons, and the color palette, which recolours the whole app (logo, titles, chips, buttons; gains and losses stay green and red): Fidelity green (the default, the family of twitter, youtube and fundamentals), Indigo Desk (gex) or Ocean blue (investments, ETFs, Stocks)
- Another browser or a phone: βοΈ Settings -> β¬ Export -> Copy to the clipboard or Save as a file, type a password (8 characters or more). There: βοΈ Settings -> β¬ Import -> Paste from the clipboard or Choose a file, type the same password, then press βοΈ once to sign in to Google. The text and the file are the same thing, encrypted in the browser (AES-256-GCM, the key from the password by PBKDF2); the password is kept nowhere; they hold the Google setup and the view, never the Google sign-in or anything the script keeps
- In the header of βοΈ Settings, right after its title: Reset (theme, palette, language, account, tab, sort, filters, columns, panels; the setup stays); with the Full box beside it ticked, Reset is a full one (also the Google setup and the cached data; the script forgets its data and Google token, the Fidelity login stays under π)
- What the browser keeps: the public Client ID and the spreadsheet id (localStorage), the last data (IndexedDB), your choices: account, tab, sort, filters, columns, theme, language. The Google token and its expiry stay in localStorage until it expires. The Fidelity login, if saved, lives only in the script's Tampermonkey storage
Sheet tabs:
| Tab | What | Written |
|---|---|---|
fidelity_accounts |
one row per account: group, type, balance, gains, cost basis, income, cash | rewritten when changed |
fidelity_positions |
positions now, the main columns plus every field as JSON | rewritten |
fidelity_balances_daily |
balance history, one row per day and account, since each account opened | added and updated |
fidelity_positions_all |
every field of every position as its own column; new fields add columns | rewritten |
fidelity_transactions |
the transactions history of every account | rewritten after its daily read |
adp_mykplan_transactions |
the ADP 401k history: date, pay date, fund, type, category, source (roth, pretax, match, nec), quantity, price, net amount | rewritten after each read on mykplan |
adp_mykplan_balances_monthly |
the 401k balance of each fund at the end of every month read and on the last price day: date, fund, quantity, price, balance | rewritten after each read on mykplan |
fidelity_transactions_synced |
how far each account's transactions were read | rewritten with it |
fidelity_betas |
the beta of each held symbol, its source and months behind it | rewritten after its daily run |
fidelity_tax_summary |
Fidelity's Tax Info YTD summary: account, tax year, form, box, amount, as of; the gains as form gain-loss, box short-term or long-term |
rewritten after each read |
fidelity_updates |
when each data set (summary, positions, transactions, betas, performance, taxes, adp) was last written | updated after every write |
One thing has one name in every tab, the names of fidelity_positions_all: account_number, account_name, symbol_name, symbol_description, quantity, week_52_low and so on, all in snake_case. A tab written under earlier names gets its header renamed in place on the next write, the rows stay
Everything this app relies on at Fidelity is listed in src/shared/contract.ts: each entry says what we expect (a page address, a selector, the fields of a row, the shape of an answer) and which of our files use it. The script checks the real data against it on every read; a broken entry shows on the corner panel and under βοΈ in the viewer as β grid.fields: POSITION.curVal is gone (fix in src/shared/parse.ts). The tests run the same checks on recorded shapes and on broken copies
- Read only: the script never trades, transfers or submits anything on Fidelity; besides the pages it runs on it asks only Fidelity's daily values, transactions, tax info, investment results, screeners and price history, each through a fixed list of addresses; the only form it fills is the login, with your saved login, only on a page with exactly one password field and a username, at most once per 30 minutes, and it stops for good when the password is refused. Syncs asked from the viewer are taken at least 10 seconds apart
- Your data goes from your browser to your Google Sheet and nowhere else: other pages on daggerok.github.io share the viewer's storage, so the script keeps the allowed spreadsheet in its own Tampermonkey storage and asks on the Fidelity panel before writing to any other one (Full reset in the viewer does not change that). The repo holds no account data: tests use made-up numbers
Bun, Parcel, React 19, TypeScript, Tailwind 4. All code lives in src/:
src/viewerthe React app (app/state, Google, i18n;ui/screens)src/sharedframework-free code used by the viewer and the script: data model, parser, Google Sheets client and tabs (ready for a Solid 2.0 viewer later)src/userscriptthe Tampermonkey script: page reader, corner panel, login, Sheets writessrc/builduserscript bundle, CSP
bun install
bun run serve # http://localhost:1237, with a dev userscript at /accounts-sync.user.js
bun test
bun run build # dist/: the viewer and the userscriptPull requests run the tests and the build; main deploys GitHub Pages. Bump version in package.json on every script change, Tampermonkey updates by it