R1-05: Instrument/participant/session config, validation, Notional - #5
Merged
Conversation
Adds the configuration layer (EXCHANGE_RULES.md §1/§9/§11/§12, NUMERIC_REPRESENTATION overflow analysis): - InstrumentConfig (R-1.1): tick/lot size, price band, max order qty, maker-taker FeeSchedule (R-11.1). - ParticipantConfig / ParticipantRisk (§9): max position, max order qty, max open orders; reserved max_notional for R2. - SessionConfig (§12): length, initial reference mark, fill estimate. - validate() on each returning ConfigError; overflow-headroom check (worst-case notional must keep >=100x int64 headroom) computed without ever overflowing intermediate products. - Notional(price, qty, instrument) = exact int64 product (R-1.3), constexpr; guaranteed non-overflowing for validated in-band inputs. Also records D19 (lean engine-first MVP sequencing). Tests: Notional exactness, per-field instrument rejection, overflow boundary (accept modest / reject 1e24), participant and session limits, aggregate-overflow rejection. 9 new tests; full suite green under debug + asan-ubsan, -Werror clean.
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.
Adds the configuration layer (EXCHANGE_RULES §1/§9/§11/§12 + overflow analysis): InstrumentConfig, ParticipantConfig/Risk, SessionConfig with validate() → ConfigError, an overflow-headroom check that never overflows its own intermediate products, and the exact constexpr Notional (R-1.3). Records D19 (lean engine-first MVP). 9 new tests; full suite green under debug + asan-ubsan, -Werror clean.