A Personal Markets Terminal
A Bloomberg-style research terminal I built on a home server. It pulls news, filings, positioning and market data into one place, on top of a security master that knows which company held each ticker on each date. Its assistant, Ask, answers questions with cited sources, and it writes a morning brief that code checks before it goes out.
I built it to replace a scatter of scripts with one tool I use every day, and to own the whole path myself: ingestion, data quality, storage, retrieval and evaluated LLM answers.
- 98% of expected items in Ask's top 30
- <½¢ per answer
- 21,581 entities resolved by date
- ~810 tests
As of November 16, 2026. The code is private because it holds licensed data.
What It Looks Like
It covers news from 57 feeds and transcribed Fed pressers and podcasts, SEC filings and 13F holdings, congressional trades, futures positioning and short interest, and prediction markets. Everything sits in one web page with a tab per dataset: Today puts the morning brief, market tiles and top stories on one screen, and Ask opens beside any tab.
How It Fits Together
Data arrives on a schedule and is cleaned, tagged and stored before anyone asks for it. Twenty-seven flows pull each source, check its quality, and tag news with tickers, sectors and an importance score. Heavy rebuilds run overnight in a chain that ends with the morning brief at 5:15 a.m. Pacific. Two products read from that store: Ask and the morning brief. The same answers reach a local page, a Telegram bot, and a separate web app for a small group of invited users behind single sign-on.
Takeaway: The slow, costly work of collecting, tagging and embedding happens once, ahead of time, so a question only pays for a search and a short model call.
Ask: Cited Answers for Under Half a Cent
Every question runs the same five steps, whether it comes from the page, the invited users' app, the Telegram bot or an automatic price-move digest. The model only chooses tools in step 4, and code controls the rest.
Takeaway: Limiting the model to one step keeps answers cheap (under half a cent) and lets me score retrieval on its own against a labeled set of questions.
Measure Retrieval Before Changing It
Ask combines keyword and vector search, then reranks the results. Every change is scored on a hand-labeled set of questions before it ships, and the current setup finds about 98% of the expected items in its top 30. A small reranker on the server's CPU also beat an LLM relevance judge, 0.979 to 0.951.
A Smaller Embedding Model Won
Production uses bge-small-en-v1.5, a 33M-parameter model that runs on the server's CPU. I tested two larger Qwen3 embedding models against it, one per job, and both did worse.
| Recall@30 | bge-small (kept) | Qwen3-Embedding-0.6B |
|---|---|---|
| Fixed search plans | 0.981 | 0.917 |
| Plans regenerated by the model | 0.955 | 0.929 |
| Measure | bge-small (kept) | Qwen3-Embedding-4B |
|---|---|---|
| Recall@1, crypto near-pairs | 0.215 | 0.019 |
| Time to embed 5,000 listings | 2.6 s | 172 s on a GPU |
Recall@k is the share of the expected items found in the top k results; higher is better. The 0.6B model also took 1.1 s per query and about 70 minutes to embed 4,330 items, so I reverted it.
Each item embeds only a headline and about 200 characters, which leaves a larger model little extra to work with. In matching, the 4B model caught the price threshold but missed the date, so near-identical markets with different dates looked the same. A switch would also mean re-tuning the story clusterer, whose thresholds fit bge-small's similarity scale.
A Fixed Workflow, Not an Open-Ended Agent
Code runs the plan, the search and the checks, and the model only picks tools while answering. That keeps a typical answer under 20 seconds and half a cent, and keeps retrieval testable.
Prompts Ship Only If They Score Better
Prompts live in a registry with versions. A new version of the news-tagging prompt is scored on hand-labeled items and reaches production only if its accuracy matches or beats the current version and clears fixed minimums. Every call is traced, so a bad answer can be traced back to its prompt version, inputs and cost.
Check the Model's Work in Code
The morning brief fails if it cites a source that doesn't exist, and it flags any number missing from its sources. Every Ask answer is also scored for groundedness by a second model, which agrees with my hand labels at a kappa of 0.90 on 28 answers; it went live only after clearing a gate of 0.6. Data licensed for my personal use never reaches invited users.
A Point-in-Time Security Master
Tickers get reused, renamed and merged away. A backtest that joins on today's ticker quietly prices the wrong company, or drops one that was acquired. The security master records which company held each ticker on each date, built from SEC filings and updated every night. Everything that joins on a ticker now goes through it: company pages, the screener, 13F holdings, congressional trades, quotes, daily prices and backtests. SentinelOne has traded as S since 2021, and asking for S as of 2016 returns Sprint, which held the ticker until 2020.
- 21,581 entities
- 154,739 filings
- 77,986 corporate events
- Identity. Every SEC submission history is loaded: names, former names, tickers and the 8-K items that mark mergers, delistings and successions.
- Dated tickers. Each ticker sits on a dated span, so a lookup asks who held a ticker on a given day, not who holds it now.
- Successions. A holding-company reorganization carries one security through to its successor. Each link opens a review until it is confirmed.
- Deal terms. Completion filings state what shareholders received, such as "the right to receive $54.20 in cash", and that consideration is stored with the merger.
Patterns First, a Model for the Rest, Code Checks Both
Text patterns read the plain deal terms. The excerpts they can't read go to a small open model (Qwen2.5-7B) on a rented GPU. A reading counts only if its quote is in the filing and its numbers appear in the quoted words. Spot checks match the published exchange ratios: GenOn into NRG at 0.1216, DuPont into DowDuPont at 1.282, Delphi into BorgWarner at 0.4307. Of the 84 mergers among the stocks I backtest on, 74 are now read. Cash-or-stock elections, contingent value rights and reverse mergers go to a person.
Filing Prefixes Are Not Tickers
Companies tag their XBRL filings with a short prefix that usually matches their ticker, but subsidiaries file under the parent's prefix and some filers use another company's. Read as tickers, these made Wells Fargo's WFC resolve to nothing from 2017 to 2026. Spans that sit inside another listing's span are now dropped.
Valuation Matched to the Business
A free-cash-flow DCF is the wrong tool for a bank, a REIT or a utility, and a single trailing year of cash flow can be badly off. The company page picks a model by industry and checks its own inputs.
| Business | Model |
|---|---|
| Most companies | Free-cash-flow DCF, growth fading to 2.5% over 12 years, plus a reverse DCF |
| Banks, insurers, bank-like brokers | Excess-return model on book equity (Damodaran) |
| Equity REITs | FFO from filings (the XBRL figure, else the reported Nareit figure), discounted at the cost of equity |
| Utilities, alternative asset managers | Dividend discount model, or excess return when there is no dividend |
Audit the Default, Then Fix the Inputs
Checking the default DCF across large caps showed most landing 20% or more below price, and seven with no value at all. The fixes: payments and capital-markets firms were wrongly grouped with banks; a trailing year far below or above the five-year average is replaced by that average (an AI capex trough, a one-off spike); and a company with no usable model now says why instead of showing a blank.
Research With Rules Written First
The factor search had its rules and pass bar written down before any return was computed, and the nulls are kept.
Pre-Register, Then Score the Holdout Once
The factor search tries candidate signals on 2010 to 2020 and held back 2021 to 2026. I wrote down the composite and the test before scoring, then scored the holdout one time: an alpha of 0.30% a month with a t-statistic of 1.18 against a bar of 1.65, so inconclusive. The code refuses a second scoring. The same composite now runs as a live paper portfolio, with its tests fixed in advance at 36 and 60 months. Two insider-trading signals went through the same process later; both failed and were closed.
Running It
Cost, With Budgets Checked Hourly
From November 1 to 15, the terminal spent about $50 on Claude API calls and $10 on rented GPUs for transcription and deal terms. Every model call is logged with its cost, an hourly check warns when a month's pace would pass its budget, and the GPU account has a hard monthly cap.
New Steps Run on a Throwaway Copy First
A new pipeline step runs against a disposable copy of the database for two nights before it touches the real one. The second night is the point: it caught a rerun that withdrew rows the first night had written, which a single run would never show. About 810 automated tests run on every change, and changes land through pull requests.
Make Failures Visible
Monitoring flagged jobs that started and never finished. Restarts were killing runs mid-flight, so the service now waits for running jobs before it stops, and every failure posts to a Telegram chat. Grafana dashboards show data freshness, run history and spend.
Lessons
- Foundational data comes first. Every feature on this page, from Ask's citations to the factor search, is only as good as the data underneath it. This project proved that to me again.
- Identity is the hard part of market data. Every source tracks companies its own way: tickers that change hands, CIKs, CUSIPs, FIGIs and filing prefixes that only look like tickers. A clean, auditable security master that every dataset joins through is not optional.
- Observability can be simple and still work. For a system one person runs, flows that post failures to a Telegram chat and a few Grafana dashboards for freshness, runs and spend are enough to run it every day.
Limits and Next Steps
- The security master's review queue was cleared, but about 3,100 merger and reorganization filings still have no deal terms read: reverse mergers, SPACs and formula-priced deals that need a person.
- The factor holdout is spent and inconclusive. The only clean test left is the live record, which needs years of new data.
- Dated ticker lookups are now wired through the terminal. Next is retiring the old ticker tables they replaced, and a weighting policy for companies with several share classes, which the valuation still refuses.
Stack
Mostly open-source tools on one home server. The Claude API is the only paid model API; embeddings and reranking run locally on the CPU, and transcription and the deal-terms model run on rented GPUs through Modal. The cloud pieces (the invited users' login, DNS and a small VM) are managed as code with OpenTofu.
- Python
- PostgreSQL
- pgvector
- ClickHouse
- Prefect
- MLflow
- Claude API
- Pydantic
- fastembed
- FastAPI
- Docker
- Modal
- vLLM
- Grafana
- OpenTofu
- Cloudflare
- GitHub Actions
Related
venue-arb runs on the same platform and is public. It checks whether the same contract trades at different prices across venues once fees and depth are counted, for prediction markets and stock and pre-IPO perpetuals (code).