Fetch prices with batched Yahoo quotes (#13) #53
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
epic:E1-foundation
epic:E2-correct-metrics
epic:E3-fast-jobs
epic:E4-cli
epic:E5-web-ui
epic:E6-history
good first issue
help wanted
invalid
question
sprint-tracking
story
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ckreidl/screener!53
Loading…
Reference in a new issue
No description provided.
Delete branch "13-batched-quotes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
🤖 Claude: Closes #13
Enrich now prices companies with
quote()calls of up to 100 symbols. It used to make onequoteSummarycall per company, one per second. Sectors still come from #14'ssector_cache. The onlyquoteSummarycall left is thesummaryProfilelookup on a cache miss.Changes
src/enrich.tsquote()runs withvalidateResult: falseand only the two fields we need. Otherwise one symbol failing the library's schema would throw away its whole batch. Both fields are checked by hand instead.Marketinterface (yahooMarketin production). This is what makes enrich testable without network access.estimatedSeconds()replacesSECONDS_PER_REQUEST: one request per batch plus one per cache miss.cli.ts: the enrich hint uses the new estimate.test/enrich.test.ts(new): enrich had no tests before.CLAUDE.md: the enrich step's description is updated.Acceptance criteria (revised, from the comment on #13)
quote(), in batches of up to 100. Tested: 250 tickers → batches of[100, 100, 50].quoteSummarycalls of this story's own. Tested: a cached company gets no profile lookup, and the SIC fallback still works. Real run: 0 profile lookups.quoteSummarypath:One finding (not caused by this change): WAT's market cap went from $46.2B to $92.5B, and SUPN's from $1.7B to $6.1B, with the same price in both runs. I checked both endpoints today.
quote()andquoteSummary'spricemodule return the same new values (WAT 98.3M shares, $92.5B; SUPN 207.7M shares, $6.1B). Yahoo's data changed overnight; batching didn't cause it. SUPN moved from rank 33 to 366 because of it. Chris treats it as a transient glitch in Yahoo's data; no issue needed.Definition of Done
bun testpasses; new logic has tests: 220 pass, 0 fail (7 new intest/enrich.test.ts)bun checkis clean andbun fmt --checkpasses: "No type errors in 28 files"; "All 4 files are formatted"bun cli.ts enrich→ "1591 priced (8 sectors from SEC SIC codes) · 0 profile lookups · 86 no ticker · 2 no quote", done in 17 s.bun cli.ts rank→ top 10 of 1,391.🤖 Generated with Claude Code