-
Notifications
You must be signed in to change notification settings - Fork 97
Description
Issue Summary
When processing a Partial Termination event, the QuantityDecreased function enforces two strict conditions:
- All quantities must decrease.
- All quantities in the after state must be greater than zero.
Certain scenarios of partial terminations could not meet both conditions above. Specifically, the system does not qualify it correctly in the following two cases:
- If only one quantity is reduced and the others remain with the same value.
- If a quantity in the trade is zero.
In cases where a quantity is decreased, and all the other quantities remain unchanged, the model should consider it a decrease (partial termination).
Steps to Reproduce
Run the function QuantityDecreased on the sample msg-partial-termination-xccy-mockup-one-qty-CDM.json and observe how the qualification is False:
Run the function QuantityDecreased on the sample msg-partial-termination-xccy-mockup-qty-zero-CDM.json and observe how the qualification is False:
Expected Behaviour
Since a quantity is being decreased, it should be captured as such and return True.
Actual Behaviour
Currently, it returns False if all quantities are not decreased or if any is equal to zero.
Proposed Solution
A possible solution could be making the function more flexible so that it is sufficient if only one quantity is reduced, as long as the other quantities remain unchanged.
On the top of that, the function could be improved to require only the quantity affected by the decrease to remain greater than zero, regardless of the values of other quantities that may have been previously defined in the trade.
General Conclusion:
The current qualification logic for events, imposes conditions on all tradeLot quantities, whereas event qualification should instead be based only on the values impacted by the event, regardless of other unaffected quantities.
Compatibility
Changes are backward-compatible.
Release
CDM 7 dev.
Additional Context
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status