Repository navigation
Rescale price.derivedQuantity in Create_QuantityChange
Summary
After Create_QuantityChange, PriceQuantity.price.derivedQuantity was being carried through from the BEFORE state unchanged, leaving it stale for equity swaps and any AssetPrice whose price carries a populated derivedQuantity.
For the partial-termination-equity-swap-func example, this showed up as LOT-2 correctly ending at 608,320 Share, but its derivedQuantity remained at the pre-termination 28,469,376 USD instead of rescaling to 22,775,500.80 USD (= 608,320 × 37.44 USD/Share). The same symptom appears on full termination, lot-level increase, and the FpML xccy partial-termination path.
Closes 4909 - the residual observation flagged while investigating here #4929 and.
Change
Introduces a RescaleDerivedQuantity helper in product-common-settlement-func.rosetta and wires it into UpdateAmountForEachMatchingQuantity, so every event routing through Create_QuantityChange (partial/full termination, lot-level increase, compression, allocation, FpML xccy partial termination, etc.) preserves the invariant:
derivedQuantity = quantity × price.value
Guards
Rescaling is deliberately skipped unless all of the following hold:
price.derivedQuantityis populated. Otherwise there's nothing to rescale, so spread rows on interest-rate payouts stay untouched.price.perUnitOfmatches the sibling quantity's unit. Currency-onlyPriceQuantityrows on IR payouts stay untouched.- The price value itself did not change between the before and updated states.
The last guard protects stock split. Create_StockSplit sends both a new quantity (preShares × adjustmentRatio) and a new price (prePrice / adjustmentRatio) through the primitive. Total notional is already preserved by construction, so recomputing newQty × newPrice would only reintroduce rounding error from the non-terminating BigDecimal division (e.g. 37.44 / 0.23) and break the "before and after must have the same notional" assertion in BusinessEventExecutionTest.mustCreateStockSplitBusinessEventAcceptedWorkflowStep.
Backward compatibility
| Area | Impact |
|---|---|
| Wire / schema | No type changes. Existing serialized CDM instances still round-trip. |
| Function API | Create_QuantityChange, UpdateAmountForEachMatchingQuantity, UpdatePriceAmountForEachMatchingQuantity and UpdateQuantityAmountForEachMatchingQuantity keep their signatures. RescaleDerivedQuantity is additive. |
| Semantic | This is a behaviour change for consumers who treated price.derivedQuantity as an immutable execution-time snapshot. For everyone else (IR / FX / credit samples with no derivedQuantity, or equity samples that expected derivedQuantity = quantity × price.value), this is a bug fix. |
resolves #5014
Proposed Enhancement to the Common Domain Model
Background
Issue #5014 reports that FX exotic options ingested from FpML were labelled incorrectly. The FpML mappings did not populate OptionPayout.feature, so the qualification functions could not distinguish a barrier, touch or average-rate option from a plain vanilla. Qualify_ForeignExchange_VanillaOption also deliberately accepted options carrying only an averagingFeature. FX digital (touch) options were mapped without an underlier, so they failed Qualify_AssetClass_ForeignExchange and received no ISDA label.
Changes
Ingestion mapping
ingest-fpml-confirmation-product-fxoption-func.rosettaMapFxOptionPayoutnow populatesfeature.barrierfrom FpML<features><barrier>andfeature.averagingFeaturefrom<features><asian>.- Barrier trigger levels carry
unit/perUnitOfderived from the barrier'squotedCurrencyPair. averagingFeature.averagingCalculationis populated.isWeightedis derived from the presence ofrateObservation/averageRateWeightingFactor. FpML does not carry the averaging method or rounding for FX average-rate options, so these default toArithmeticandNearest(market convention for FX average-rate options).
ingest-fpml-confirmation-product-fxdigitaloption-func.rosettaMapFxDigitalOptionPayoutnow populatesfeature.barrierfrom FpML<touch>(Touch→knockIn,Notouch→knockOut). Trigger levels carryunit/perUnitOffrom the touch'squotedCurrencyPair.- The underlier is mapped as
Cashin the base currency of the touch'squotedCurrencyPair, using the same convention as vanilla FX options, where the underlier is the strike'sperUnitOfcurrency. It is only mapped when a<touch>is present.
Qualification (product-qualification-func.rosetta)
- New
Qualify_ForeignExchange_SimpleExotic_Barrier: FX option with a barrier, underlier and strike. - New
Qualify_ForeignExchange_SimpleExotic_Digital: FX option with a barrier and no strike (binary / touch). - New
Qualify_ForeignExchange_SimpleExotic_Asian: FX option with an averaging feature, underlier and strike. Qualify_ForeignExchange_VanillaOptionnow requiresfeature is absent. TheaveragingFeature only existscarve-out is removed, so average-rate options no longer qualify as both vanilla and Asian.
Samples / expectations
- Regenerated 21 FX trade-state outputs across
fpml-5-10,fpml-5-12andfpml-5-13(fx-ex12, 13, 16–22) and the 5 correspondingtest-pack-translate-*configs.
Documentation
- New
ingest/README-INCOMPLETE-SAMPLES.mdlists theinput/*incomplete-*sample folders and explains why their FpML→CDM ingestion is not yet complete (per the CRWG decision of 29 Sep 2026). It sits outsideingest/input/because the test-pack writer parses every file in those folders as FpML.
Backward Compatibility
| Area | Impact |
|---|---|
| Wire / schema | None. No types or attributes added, removed or changed. |
| Function API | Additive: three new qualification functions. No signatures changed. |
| Semantic / qualification | Behaviour change. FX barrier options now qualify as ForeignExchange_SimpleExotic_Barrier and average-rate options as ForeignExchange_SimpleExotic_Asian; both were previously ForeignExchange_VanillaOption. FX touch / no-touch options now qualify as ForeignExchange_SimpleExotic_Digital; they previously had no ISDA label. Any FX option carrying an averagingFeature no longer qualifies as ForeignExchange_VanillaOption. Ingested FX digital options now carry an underlier. |
| Expectations | modelValidationFailures is unchanged for the barrier and average-rate samples. It improves by 1 for the touch samples fx-ex16–19, which now have an underlier. No runtime errors. |
Cross reference
This PR: to be added · Issue: #5014
Supporting Documentation
- CRWG decision (29 Sep 2026): document why the
incomplete-*FpML sample folders are not fully mapped. - Known gap / follow-up: European digital options (fx-ex14, fx-ex15) use FpML
<trigger>rather than<touch>. They are not mapped by this PR and still receive no ISDA label. - Defaulted values:
averagingCalculation.averagingMethod.calculationMethod = Arithmeticandprecision.roundingDirection = Nearestare defaults, not sourced from FpML. Reviewers may prefer makingAveragingFeature.averagingCalculationoptional instead; happy to change.
Product Model - Make party roles optional for Cash
Background
Where a TransferableProduct contains an asset that is Cash it does not need to enforce the setting of the productPartyRole nor the partyRole under the asset itself.
What is being released?
Changes:
productPartyRoleinTransferableProducthas been changed from (1..1) to (0..1) cardinality i.e. it is now optional- a new
PartyRolesExistcondition has been added that ensures that theproductPartyRoleand thepartyRoleunder theassetare set for all assets other than Cash i.e. Commodity, DigitalAsset, Instrument - the
AssetPartyRoleExistscondition has been removed as the logic has been rolled into the newPartyRolesExistcondition - the description for
AssetPayouthas been slightly modified
Review Directions
Changes can be reviewed in PR: #5207