Skip to content

Conversation

@regnosys-prod-user
Copy link
Collaborator

No description provided.

@regnosys-prod-user regnosys-prod-user requested a review from a team as a code owner September 20, 2025 00:26
@regnosys-prod-user
Copy link
Collaborator Author

CDM Event Model - Qualification for Termination and Partial Termination

Background

The current qualification logic for Termination and Partial Termination events imposes conditions on all tradeLot quantities. This is incorrect because, for certain products (e.g. bond options), some tradeLot values represent trade features that are not expected to be impacted by the event. Therefore, they should not be considered in the qualification logic, as they can lead to misqualifying the event. Event qualification should instead be based only on the values impacted by the event, regardless of other unaffected quantities.

This release updates the logic for qualifying partial terminations and full terminations by applying constraints only to relevant quantities.

What is being released?

This release updates the following functions:

Partial Termination qualification

  • QuantityDecreased: updated to check that changed quantities have not decreased to zero, instead of checking that all quantities in the resulting tradeLot are greater than zero. This check is done through the function QuantityDecreasedToZero.

  • CompareTradeLot: updated to succeed if at least one quantity meets the condition.

Termination qualification

  • QuantityDecreasedToZero: updated to take the instruction as input and extract the unitTypes from the quantityChange instructions. The constaint now is applied only to quantities with the same unit type — assuming those are the ones affected by the event.

  • CompareTradeStatesToAmount: updated to allow unitType to be specified as input. If unit types are specified, only quantities with those units are compared. Otherwise, the comparison applies to all quantities.

  • CompareTradeLotToAmount: updated to allow unitType to be specified as input. If unit types are specified, only quantities with those units are compared. Otherwise, the comparison applies to all quantities.

Termination construction

  • Create_QuantityChange: updated to set positionState to Closed if all quantities with the instruction’s unit have decreased to zero.

Additional updates

  • Minor technical adjustments were made to the following functions to accommodate the above changes, without any impact on the business logic:
    Qualify_FullReturn, Qualify_PartialNovation, Qualify_PartialTermination, Qualify_Reallocation, Qualify_Repurchase, Qualify_Renegotiation, Qualify_Termination.

Review Directions

Changes can be reviewed in PR: #4042

Note

This comment was generated via Rosetta.

@regnosys-prod-user regnosys-prod-user added the Rosetta Pull requests which can be viewed in Rosetta label Sep 20, 2025
@netlify
Copy link

netlify bot commented Sep 20, 2025

Deploy Preview for finos-cdm ready!

Name Link
🔨 Latest commit 9ae7102
🔍 Latest deploy log https://app.netlify.com/projects/finos-cdm/deploys/68e7d6d92704400008eee396
😎 Deploy Preview https://deploy-preview-4042--finos-cdm.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

…sses/ir-option-debt-option-ex01-term-cdm.xml

Removing file uploaded by mistake.
…10-processes.json

Removing file uploaded by mistake.
…10-processes.json

Removing file uploaded by mistake.
@gtarres
Copy link
Contributor

gtarres commented Sep 22, 2025

This PR solves issues #3987 and #3798.

@CDM-ReleaseManagement-OT
Copy link
Contributor

@JayasriR can you please investigate why the build is failing and create a separate release PR?

Copy link
Contributor

@chrisisla chrisisla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've still got a couple of changes to review so will add some further comments when I am able to pick this up again (which should be this week) 👍

Main thing I need to think about is whether there is anything that might prevent the QuantityDecreased functions from taking an instruction as input rather than a tradeState.

func QuantityDecreasedToZero:
inputs:
before TradeState (0..*)
instruction Instruction (0..*)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question of cardinality as QuantityDecreased function. Interesting that originally tradeState was (0..*) here but (1..1) for QuantityDecreased.

set quantityChange -> state -> positionState:
if newTradeLots -> priceQuantity -> quantity -> value all = 0
then PositionStatusEnum -> Closed
set quantityChange -> state -> positionState: <"Set positionState to Closed if all quantities with the instruction’s unit have decreased to zero.">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not convinced this is correct. For a stock loan against cash you would have 2 quantities, one holding the securities (unit = financialUnit -> Share) and one holding the cash (unit = currency). Both of these quantities would need to be set to zero in order to set the positionState to "Closed".
If the QuantityChange instruction only decreases one of these quantities to zero then this condition I think would still set the trade to Closed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. If we can have quantities with mixed types of units related to the actual quantities exchanged, then we'll need to rethink this logic.

This has been modelled from a Debt Option perspective, where we expect the trade to be closed even if the option entitlement quantity, which has a unit type of funancialUnit, is not reduced to zero, as this quantity is just a feature of the contract.

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay, what we may need to do then is check the product to determine what constitutes a Termination, or have separate functions to qualify termination for different product types. Either way it looks like it is not as straightforward as we'd hoped 🙁

@chrisisla
Copy link
Contributor

I have no further review comments. I think that using instruction will be fine, as it provides the ability to check for only those items updated by a specific event, and the QuantityDecreased... functions all currently appear to only be used to qualify events.

@regnosys-prod-user regnosys-prod-user removed the Rosetta Pull requests which can be viewed in Rosetta label Oct 9, 2025
@regnosys-prod-user
Copy link
Collaborator Author

What is being released?

Fixed input cardinality and optimized unitType logic.

Note

This comment was generated via Rosetta.

@regnosys-prod-user regnosys-prod-user added the Rosetta Pull requests which can be viewed in Rosetta label Oct 9, 2025
@gtarres
Copy link
Contributor

gtarres commented Oct 9, 2025

I have no further review comments. I think that using instruction will be fine, as it provides the ability to check for only those items updated by a specific event, and the QuantityDecreased... functions all currently appear to only be used to qualify events.

Added a new commit 9ae7102 adjusting the Instruction cardinality to (1..1) and removing redundant logic in CompareTradeStatesToAmount. Additionally, I've simplified the logic in function CompareTradeLotToAmount, now it should look cleaner.

We'll think about your last comment about the Closed state and try to propose an improvement in the upcoming days.

Thanks a lot for the review @chrisisla ,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Rosetta Pull requests which can be viewed in Rosetta

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Partial Termination Not Qualified properly The qualification logic for Terminations doesn't align with the changes expected for this event

4 participants