Repository navigation
6.0: ComboLeg and delta-neutral slots are ShortSaleSlot, not i32 - #1258
Open
tradatious wants to merge 1 commit into
Open
tradatious wants to merge 1 commit into
tradatious wants to merge 1 commit into
Conversation
ComboLeg::short_sale_slot and Order::delta_neutral_short_sale_slot become orders::ShortSaleSlot, the enum Order::short_sale_slot holds; serialized, each is the variant name. ComboLeg rustdoc gains the exempt_code codes and the unsent ratio of a defaulted leg, with its wire-facts entry (321). CHANGELOG, enum-typing ledger. Migration §42.
tradatious
force-pushed
the
api_b_combo-leg-types
branch
from
November 16, 2026 19:05
9647454 to
3b8c912
Compare
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
Order::short_sale_slotis anorders::ShortSaleSlot, but the same code on a combo leg (ComboLeg::short_sale_slot) and on the delta-neutral hedge (Order::delta_neutral_short_sale_slot) was a barei32documented as "1 = clearing broker, 2 = third party". Both now hold the enum. An unmodeled code isShortSaleSlot::Unknown(code)and is sent back unchanged;Noneis still sent as no value, so nothing changes on the wire.Also in
ComboLeg's rustdoc:exempt_codesaid "0 = none"; it now gives the codes fromComboLeg.proto(0does not apply the uptick rule,-1applies it).ratio: 0, which is not sent, and TWS rejects a leg without a ratio with 321 (probed 2026-11-15, what-if; entry added todocs/wire-facts/orders.md).ComboLeg::exchangestays aString:Exchange::default()is"SMART", so typing it would make a defaulted leg sendSMARTwhere it sends nothing today.Testing
cargo fmt --checkcargo clippy --all-targets -- -D warningscargo clippy --all-targets --no-default-features --features sync -- -D warningscargo clippy --all-targets --all-features -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc --no-depsRUSTDOCFLAGS="-D warnings" cargo doc --no-deps --no-default-features --features syncRUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-featurescargo test --all-featurescargo clippy -p ibapi-integration-sync --tests -- -D warningscargo clippy -p ibapi-integration-async --tests -- -D warnings./tools/check-rules-graph.shThe typing itself was not tested live: the encoder and decoder tests cover
None,Broker,ThirdPartyand an unmodeled code for both fields. What TWS echoes for either slot was not probed.Breaking changes
Yes. Assignments and comparisons on the two fields use
ShortSaleSlotvariants; the compiler reports each. Not caught by the compiler:ComboLegandOrderJSON carries the variant name where it carried a number. That form follows the deriveOrder::short_sale_slotalready has; if #1245 settles on integers for integer-coded enums, these two fields follow it. Migration §42 (numbered after #1257's §41).