Skip to content

fix(orders): preserve unknown execution liquidity codes - #760

Merged
wboayue merged 2 commits into
wboayue:mainfrom
faysou:fix/unknown-execution-liquidity
Aug 27, 2026
Merged

fix(orders): preserve unknown execution liquidity codes#760
wboayue merged 2 commits into
wboayue:mainfrom
faysou:fix/unknown-execution-liquidity

Conversation

@faysou

@faysou faysou commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Map the documented execution liquidity codes as before, including wire code zero as Liquidity::None. Preserve every other value as Liquidity::Unknown(i32) so callers can log, store, or reject an unsupported code without silently treating it as missing data.

flowchart LR
    Wire[Execution liquidity code] --> Known{Code 0 to 3?}
    Known -- Yes --> Variant[Known Liquidity variant]
    Known -- No --> Unknown[Liquidity::Unknown with original code]
Loading

The conversion remains infallible while retaining the wire value for forward compatibility.

Testing

  • cargo test -p ibapi --features sync.
  • Unit coverage for zero, positive unknown, and negative unknown codes.

faysou and others added 2 commits August 17, 2026 02:19
- Preserve unsupported wire codes as Liquidity::Unknown
- Keep wire code zero mapped to Liquidity::None
@wboayue

wboayue commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Thanks @faysou! Nice catch on preserving the wire value — verified against the official clients that 0–3 is the complete documented set, so Unknown(i32) is exactly the right forward-compat move. I pushed a changelog entry to the branch; will land this with the next breaking release since Liquidity is deliberately exhaustive.

@wboayue
wboayue merged commit 797bcd2 into wboayue:main Aug 27, 2026
4 checks passed
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.

2 participants