Skip to content

fix: watchlist quote reliability, portfolio InstrumentRef, and ETF cache - #177

Merged
Travisun merged 4 commits into
mainfrom
fix/chart-cyq-align-cross-market-summary
Aug 26, 2026
Merged

fix: watchlist quote reliability, portfolio InstrumentRef, and ETF cache#177
Travisun merged 4 commits into
mainfrom
fix/chart-cyq-align-cross-market-summary

Conversation

@Travisun

Copy link
Copy Markdown
Owner

Summary

  • Harden watchlist quotes: stale fallback on live failure, single-instrument fresh quote API, immediate prefetch on add with addedPrice placeholder, and per-symbol ETF batch cache writes.
  • Align portfolio ledger on InstrumentRef with four-instrument CRUD/PnL tests; unify capability matrix and batch realtime sharding fixes.

Test plan

  • npm run build:packages
  • npm run check:ui
  • node --test tests/watchlist-quote-prefetch.test.mjs tests/instrument-quote-stale-fallback.test.mjs tests/watchlist-quote-cache-merge.test.mjs
  • Add CN ETF (e.g. CN:SZ.159855) to watchlist — price appears without restart
  • Remove/re-add symbol — stale cache only clears on delete or explicit fresh

Made with Cursor

Rui and others added 4 commits August 26, 2026 12:45
Make holdings/trades first-class InstrumentRef citizens with portfolio profiles,
fund_quote routing, and collision-safe storage keys; batch and shard large watchlist
realtime refreshes; consolidate application capability matrix in shared with ETF/JP/KR/CRYPTO rows.

Co-authored-by: Cursor <cursoragent@cursor.com>
Exercise CN equity/ETF/FUND and HK equity with 52+ trades each, OTC fee
overrides with recomputation, multi-holding summary, and PnL parity checks.

Co-authored-by: Cursor <cursoragent@cursor.com>
…uote

When live batch/single fetches fail, Hub now returns the last cached or
in-process price instead of marking rows failed; CN watchlist realtime
writes short-TTL cache and membership changes only invalidate added/removed
symbols. Adds POST /api/instruments/quote, grace-period UX, and merge rules
so rows with any valid price never show a failure state.

Co-authored-by: Cursor <cursoragent@cursor.com>
addItemAndSync now prefetches fresh quotes for all add paths with addedPrice
fallback; batch CN realtime writes per-symbol watchlist cache for stale
recovery; watchlist save only invalidates removed symbols.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Travisun
Travisun merged commit 90e26c2 into main Aug 26, 2026
1 check failed
@Travisun
Travisun deleted the fix/chart-cyq-align-cross-market-summary branch August 26, 2026 07:32
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