Skip to content

Commit

Permalink
Rguitart option exercise terms conditions release dev (#2921)
Browse files Browse the repository at this point in the history
* AmericanExercise Condition Update v2

Modification of AmericanExercise condition within ExerciseTerms to restrict expirationDate to only 1 occurrence

* add Release note

* Update RELEASE.md

* Update RELEASE.md

---------

Co-authored-by: Roger Guitart <rguitart@tradeheader.com>
Co-authored-by: rogerguitart <141412602+rogerguitart@users.noreply.github.com>
Co-authored-by: lolabeis <leo.labeis@regnosys.com>
  • Loading branch information
4 people committed May 10, 2024
1 parent 231996a commit c4514f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 deletions.
30 changes: 7 additions & 23 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,19 @@
# *CDM Model - RoundToPrecision Function*
# *Product Model - Modification of AmericanExercise Condition in ExerciseTerms*

_Background_

This release contains a bug fix for `RoundToPrecision` function, as described in issue [#2915](https://github.com/finos/common-domain-model/issues/2915).
The conditions under `ExerciseTerms` in the refactored `OptionPayout` are not sufficiently restrictive for American options. More specifically, the `AmericanExercise` condition should not only control that the `expirationDate` is present (which it already does through the `CommencementAndExpirationDate` condition), but that it is also **present only once** (not currently implemented in the model). This release aims at modifying the `AmericanExercise` condition to correct this.

_What is being released?_

This release updates the existing function `cdm.base.math.RoundToPrecision` to round to the correct number of decimal places.
- The `AmericanExercise` condition under the `ExerciseTerms` type has been modified to constrain the `expirationDate` field to only one occurrence.

```
func RoundToPrecision: <"Round a rate to the supplied precision, using the supplied rounding direction">
inputs:
value number (1..1) <"The original (unrounded) number.">
precision int (1..1) <"The number of decimal digits of precision.">
roundingMode RoundingDirectionEnum (1..1) <"The method of rounding (up/down/nearest).">
output:
roundedValue number (1..1) <"The value to the desired precision">
```
_Backward Incompatible Changes_

The following examples show the function behaviour:

- `RoundToPrecision(1023.123456789, 5, RoundingDirectionEnum -> NEAREST)` = 1023.12346
- `RoundToPrecision(1023.123456789, 5, RoundingDirectionEnum -> UP)` = 1023.12346
- `RoundToPrecision(1023.123456789, 5, RoundingDirectionEnum -> DOWN)` = 1023.12345
- `RoundToPrecision(1023.123456789, 0, RoundingDirectionEnum -> NEAREST)` = 1023
- `RoundToPrecision(1023.1, 7, RoundingDirectionEnum -> NEAREST)` = 1023.1000000
It should be noted that this proposal contains a backwards incompatible change, given that a condition has been made stricter, but should not impact any of the actual implementations.

_Review Directions_

In Rosetta, select the Textual Browser and inspect the changes identified above.

In GitHub, review Java unit tests `cdm.base.math.functions.RoundToPrecisionImplTest` and `cdm.product.asset.floatingrate.functions.ApplyFloatingRateProcessingTest`.
In Rosetta, select the Textual Browser and inspect the change identified above.

Changes can be reviewed in PR [#2917](https://github.com/finos/common-domain-model/pull/2917)
Changes can be reviewed in PR [#2914](https://github.com/finos/common-domain-model/pull/2914)
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ type ExerciseTerms: <"A class defining the exercise period for an option togethe
condition AmericanExercise: <"Condition to check that only fields expected for an american option are present.">
if style = OptionExerciseStyleEnum -> American then
commencementDate exists and
exerciseFee is absent and partialExercise is absent
exerciseFee is absent and partialExercise is absent
and expirationDate count = 1

condition EuropeanExercise: <"Condition to check that only fields expected for a european option are present.">
Expand Down

0 comments on commit c4514f3

Please sign in to comment.