caelum0x 798d5821a2 feat(quant): single-currency multi-instrument Portfolio aggregation
Add a `Portfolio` contract to lawsynth-quant: an ordered, single-currency
book of `Lot`s that aggregates exact cost basis, mark-to-market value,
gross notional, and unrealized P&L. Every total reuses `Money`'s
overflow-checked integer algebra, so figures are exact — no rounding, no
binary floating point, no silent wrapping.

Marks are supplied by a caller per-instrument resolver, so the portfolio
never sources or infers a price; an unpriced instrument is rejected rather
than defaulted to zero. Foreign-currency lots and mark currency mismatches
are rejected, never silently converted. Adds a deterministic versioned byte
encoding (`LSQF1`) with a length-prefixed lot sequence and a strict decoder
that rejects unknown versions, truncation, over-large lot counts,
currency drift, and trailing bytes.

Promotes the "multi-instrument portfolio aggregation" item that the Lot
slice deferred; realized P&L, lot-matched fill accounting, FX, financing,
and fees remain out of scope. Updates the quant-foundation spec + changelog
and adds a new `MissingMark` error variant. 5 new tests (18 total pass);
clippy -D warnings and rustfmt clean.
2026-08-26 14:58:18 +03:00
..