-
Notifications
You must be signed in to change notification settings - Fork 95
Georgina Tarres CDM Event Model - Qualification for Termination and Partial Termination #4042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
fd7fea0
67e6988
a710786
fc3f2b4
9ae7102
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,10 +38,13 @@ func QuantityIncreased: | |
|
|
||
| func QuantityDecreased: | ||
| inputs: | ||
| before TradeState (1..1) | ||
| instruction Instruction (1..1) | ||
| after TradeState (0..*) | ||
| output: | ||
| result boolean (1..1) | ||
|
|
||
| alias unitType: <"Unit Types of the instruction's quantities."> | ||
| instruction -> primitiveInstruction -> quantityChange -> change -> quantity -> unit | ||
|
|
||
| set result: | ||
| after | ||
|
|
@@ -50,43 +53,45 @@ func QuantityDecreased: | |
| CompareTradeLot( | ||
| item -> trade -> tradeLot only-element, | ||
| CompareOp -> LessThan, | ||
| before -> trade -> tradeLot only-element | ||
| ) = True | ||
| and // check each after (item) is greater than zero | ||
| CompareTradeLotToAmount( | ||
| item -> trade -> tradeLot only-element, | ||
| CompareOp -> GreaterThan, | ||
| 0.0 | ||
| instruction -> before -> trade -> tradeLot only-element | ||
| ) = True | ||
| and // Check that changed quantities have not decreased to zero | ||
| QuantityDecreasedToZero(instruction, after) = False | ||
| ] all = True | ||
|
|
||
| func QuantityDecreasedToZero: | ||
| inputs: | ||
| before TradeState (0..*) | ||
| instruction Instruction (1..1) | ||
| after TradeState (0..*) | ||
| output: | ||
| result boolean (1..1) | ||
|
|
||
| alias unitTypes: <"Unit Types of the instruction's quantities."> | ||
| instruction -> primitiveInstruction -> quantityChange -> change -> quantity -> unit | ||
|
|
||
| set result: | ||
| CompareTradeLotToAmount( | ||
| before -> trade -> tradeLot only-element, | ||
| instruction -> before -> trade -> tradeLot only-element, | ||
| CompareOp -> GreaterThan, | ||
| 0.0 | ||
| 0.0, | ||
| unitTypes | ||
| ) = True | ||
| and CompareTradeStatesToAmount(after, CompareOp -> Equals, 0.0) = True | ||
| and CompareTradeStatesToAmount(after, CompareOp -> Equals, 0.0, unitTypes) = True | ||
|
|
||
| func CompareTradeStatesToAmount: <"For each TradeState, compare the Quantity amounts in each TradeState to the given amount (regardless of unit of amount), based on the CompareOp enum."> | ||
| func CompareTradeStatesToAmount: <"For each TradeState, compare the Quantity amounts in each TradeState to the given amount based on the CompareOp enum. If Unit Types are specified, only quantities with those units are compared. Otherwise, the comparison applies to all quantities, regardless of the unit type."> | ||
| inputs: | ||
| tradeStates TradeState (0..*) <"List of TradeState to be compared."> | ||
| op CompareOp (1..1) <"Comparison operation to use."> | ||
| amount number (1..1) <"Quantity amount to use."> | ||
| unitType UnitType (0..*) <"Unit Types to which condition should be applied."> | ||
|
|
||
| output: | ||
| result boolean (1..1) | ||
|
|
||
| set result: | ||
| set result: <"Result of applying the comparison. If Unit Types are provided, returns the result based only on quantities with those units; otherwise, returns the result for all quantities."> | ||
| tradeStates | ||
| extract [ | ||
| CompareTradeLotToAmount(item -> trade -> tradeLot only-element, op, amount) | ||
| CompareTradeLotToAmount(item -> trade -> tradeLot only-element, op, amount, unitType) | ||
| ] all = True | ||
|
|
||
| func TransfersForDate: | ||
|
|
@@ -988,9 +993,11 @@ func Create_QuantityChange: <"A specification of the inputs, outputs and constra | |
| set quantityChange -> trade -> ancillaryParty: trade -> ancillaryParty | ||
| set quantityChange -> trade -> adjustment: trade -> adjustment | ||
|
|
||
| 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."> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 🙁 |
||
| newTradeLots -> priceQuantity -> quantity | ||
| filter instruction -> change -> quantity -> unit any = item -> unit | ||
| then if item -> value all = 0 | ||
| then PositionStatusEnum -> Closed | ||
|
|
||
| func Create_TermsChange: <"A specification of the inputs, outputs and constraints when calculating the after tradeState based Terms Change Primitive Instruction."> | ||
| inputs: | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.