Skip to content

fix(history): keep the published adjusted close within Yahoo float noise - #79

Merged
daggerok merged 2 commits into
mainfrom
fix/adjclose-noise
Oct 13, 2026
Merged

daggerok merged 2 commits into
mainfrom
fix/adjclose-noise

Conversation

@daggerok

Copy link
Copy Markdown
Owner

What changed

  • fix(history): keep the published adjusted close within Yahoo float noise
  • fix(catalog): keep WisdomTree category and net assets stable across runs

Why

Yahoo returns adjclose as float32 and its last digits move with the request's period2, so a value on a cent boundary (31.544998 vs 31.545001) rounded to a different cent on each run: a rerun with identical upstream data rewrote history pages and marked funds updated, against the zero-diff rule. The published cent is now kept while the raw value stays within 0.005 + ADJ_CLOSE_NOISE (1e-4) of it; real changes are still written. Same rule as AAM

How it was checked

  • bun test: 49 pass (new two-run jitter test fails on the old code)
  • bun build (scripts/update-data.ts, src/main.tsx), bun run build, git diff --check
  • etf-std check-readme, check-workflow, check-pages, check-scripts; tc/check.sh type check clean
  • live run TICKERS= twice: the second run leaves git status unchanged

When the live catalog is unreachable the fund row comes from the previous index, which carries only the top-level category and the published net assets value. The run then published the coarse category as categoryPath and relabelled the retained net assets as SEC N-PORT-P, so a rerun with the same upstream data flipped the fund to updated. The published categoryPath and net assets source are now kept in that case.
@daggerok
daggerok merged commit 19cea37 into main Oct 13, 2026
1 check passed
@daggerok
daggerok deleted the fix/adjclose-noise branch October 13, 2026 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant