[WSAPI-11] Add total investments-balance endpoint (cash + priced positions) #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/WSAPI-11"
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?
Ticket
WSAPI-11 Add a total investments-balance endpoint (cash + priced positions)
Summary
GET /balance, serving a cached total investments balance — cash plus priced non-cash holdings, per account and grand — computed nightly bysync/balancesfromlib/wealthsimple/accounts+lib/wealthsimple/balances+lib/wealthsimple/securities'sfetchSecurityQuotes()(added in WSAPI-10, and exercised against real data by this ticket for the first time).{ cad, usd }object mirroring the existing cash shape, rather than a single (and wrong) blended number.requestedQuotes/pricedQuotesride alongside every total, cached and served from/balance, so a consumer can tell a fully-priced total apart from one degraded to cash-only (or partially unpriced) after a securities-fetch failure — that failure is isolated to its own try/catch so it no longer makes/positions//accountsgo stale too, but without this signal it would otherwise look identical to a healthy sync (ok: true, freshsyncedAt,GET /statussuccess).SessionDeadErrorraised mid-quotes-fetch still halts the whole sync rather than being swallowed by that isolation, preserving the existing "never retry authentication in a loop" contract.lib/wealthsimple/balances,lib/account-balances-cache,sync/balances, androutes/balance, plus doc updates to bothCLAUDE.mdfiles (and a final pass compressing the sections this ticket touched, since several review rounds had let them grow — see the last commit).