Repository navigation
6.0: account_updates_multi takes a LedgerOnly - #1183
Merged
wboayue merged 3 commits intoNov 5, 2026
Merged
Conversation
tradatious
force-pushed
the
api_b_account-updates-multi-ledger
branch
2 times, most recently
from
November 5, 2026 20:44
db9ad8c to
53cd7b0
Compare
`Client::account_updates_multi` (async and blocking) takes `ledger_and_nlv: bool`: `true` delivers only the per-currency `$LEDGER-*` keys, `false` those plus the account-level keys. Previously the request always sent `true`. Rustdoc, example, CHANGELOG, migration guide, wire-facts.
tradatious
force-pushed
the
api_b_account-updates-multi-ledger
branch
from
November 5, 2026 21:46
53cd7b0 to
29020f2
Compare
A bare bool after two positional Options reads as account_updates_multi(Some(&a), None, true); LedgerOnly::Yes/No names the choice, following SmartDepth/IgnoreSize. No Default: the caller picks, as the migration section already says. Converted to the wire bool at the client boundary, so encoder and test builder are unchanged. Also: "behaviour" -> "behavior" in CHANGELOG; capitalized arg doc.
… integration tests Conversion to the wire bool now lives once in the shared encoder instead of in both the sync and async client methods.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Client::account_updates_multi(async and blocking) takes a third argument,ledger_and_nlv: bool, the flag of TWS'sreqAccountUpdatesMulti.truedelivers only the per-currency$LEDGER-*keys ($LEDGER-CashBalance,$LEDGER-NetLiquidationByCurrency, ..., one set per currency and forBASE), TWS's light-weight request;falsedelivers those plus the account-level keys without the prefix (NetLiquidation,BuyingPower,AvailableFunds, ...). Previously the encoder always senttrue, so the account-level keys could not be requested. The flag is encoded like the crate's other request flags (some_bool: set only whentrue, as the official client does).Verified against a live gateway (read-only, server 226, one account, no model code):
truereturned the 75$LEDGER-*values (25 keys × 3 currencies) and nothing else;falsereturned those plus 72 values of 70 account-level keys. IB's doc page describestrueas "returns light-weight request; only currency positions as opposed to account values and currency positions" (interactivebrokers.com/docs/tws-api/doc/account-portfolio-data/account-update-by-model/requesting-account-update-by-model); the proto field comment ("Set as True if currency and net liquidation values should be delivered with updates") reads as iftrueadds data, so the rustdoc, migration section and CHANGELOG say which keys arrive instead of using either phrasing. Entry indocs/wire-facts/accounts.md. The blockingaccount_updates_multirustdoc also drops the sentence copied fromaccount_updates("All account values and positions will be returned initially ... every 3 minutes"), which describes that request's cadence; the async doc never had it.Testing
cargo fmt --checkcargo clippy --all-targets -- -D warnings(default,--no-default-features --features sync,--all-features)cargo doc --no-depswithRUSTDOCFLAGS="-D warnings"(same three configurations)cargo test(same three configurations)cargo build --examples(same three configurations)cargo build -p ibapi-integration-sync --tests,cargo build -p ibapi-integration-async --testscargo clippy -p ibapi-integration-sync --tests -- -D warnings,cargo clippy -p ibapi-integration-async --tests -- -D warningsAll pass on the change. After the rebase onto current main:
cargo clippy --all-targets --all-features -- -D warningsandcargo test --all-features; the later docs-only amends:cargo fmt --checkandcargo doc --no-deps --all-featureswithRUSTDOCFLAGS="-D warnings".Breaking changes
Yes. Callers of
account_updates_multiadd a third argument;LedgerOnly::Yeskeeps the previous behavior. Migration §16.