Skip to content

R1-05: Instrument/participant/session config, validation, Notional - #5

Merged
aravgarg28 merged 1 commit into
mainfrom
task/R1-05-config
Aug 15, 2026
Merged

R1-05: Instrument/participant/session config, validation, Notional#5
aravgarg28 merged 1 commit into
mainfrom
task/R1-05-config

Conversation

@aravgarg28

Copy link
Copy Markdown
Owner

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.

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.
@aravgarg28
aravgarg28 merged commit fd31441 into main Aug 15, 2026
5 checks passed
@aravgarg28
aravgarg28 deleted the task/R1-05-config branch August 15, 2026 12:34
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.

1 participant