market-bot: market research I can come back and check
By Nejc Mursic ·
Once the market has moved, any explanation sounds plausible. I know I fall for that, so I built market-bot to leave a record. Every report keeps its sources and evidence next to predictions I can compare with what actually happened. The same worry applies to published results: The Alpha Illusion argues that reported alpha from LLM trading agents can’t tell skill from leakage, unmodeled costs, or noise, so it shouldn’t count as deployment evidence.
nejcm/market-botBun and TypeScript CLI that turns public market data into sourced research with measurable predictions.TypeScript(opens in new tab)It’s a Bun and TypeScript CLI. Give it an equity or a crypto asset and it collects the data, runs the evidence through a few model stages, and writes everything to disk. Yahoo Finance is the main source for equities, CoinGecko for crypto. SEC filings, macro series, and options data come from other providers. The output is research and nothing more: no buy or sell calls, no position sizes, no execution instructions.
Runs live on disk
I wanted the research to outlive the process that made it. Each run gets a directory, data/runs/<run-id>/, with report.json, report.md, and whatever evidence and diagnostics that run produced. Those files are the source of truth. There’s also a SQLite index so I can query across runs, but it’s built from the files. If it breaks, the saved research is untouched.
A run is staged and then published with an atomic rename, so nobody ever opens a half-written one. If the final synthesis step fails, no validated report gets published. The CLI saves failure.json and the rejected report instead, and I can read the failure alongside the evidence it had already collected.
The deep equity command from the README:
bun run src/cli.ts equity AAPL --deep
It needs a configured model provider. On top of the model analysis, the deep path adds SEC, options, and peer evidence packets, which are deterministic. What it can gather depends on which optional provider credentials you’ve set. Without the options token, the report says there’s an options evidence gap, and I’d rather see that than have the model make something up to fill the section. Deep runs are slower and burn more provider tokens than the default brief path, so the docs start with the brief.
Predictions the scorer can resolve
Each prediction has a measurableAs expression in a small domain-specific language. Code parses it and generates the public claim from it. Whatever claim the model wrote on its own gets thrown away. So the sentence in the report always matches the event the scorer will check later.
When predictions come due, score resolves them against public observations and calibration rebuilds the summary. The probability on a prediction means one thing: the chance that its parsed expression turns out true. There’s no quota. The count is a soft target, and a report can say it came up short instead of running another model pass to squeeze out more forecasts.
Scoring against outcomes that haven’t happened yet is how ForecastBench avoids leakage by design. KalshiBench applies the same idea to questions resolved after the models’ training cutoffs, and found all five models it tested overconfident. That is why calibration is a command here and not an afterthought.
The recent forecasting design goes a step further. It compares the model’s probabilities with a versioned forecast baseline. When baseline inputs are missing, the report declares the gap. When there isn’t enough evidence to compare, it reports not-yet-decidable. All of this just lets me measure the forecasts. It says nothing yet about whether the model beats the baseline, and FINSABER is a reminder to expect that answer to be less flattering than short backtests suggest.
Stale data stays out
If a source refresh fails, the stale cached content can stay in the raw audit record. It never becomes normalized current evidence, and the report discloses the gap. That makes a bad conclusion easier to debug: before I touch a prompt, I check whether the model simply didn’t have current inputs.