Chris Rayner Event Model - Support for Rate Changes on Securities Lending trades#4690
Conversation
Event Model - Support for Rate Changes on Securities Lending tradesBackground The processing of the What is being released? The key changes are as follows: Function
Function
Function
Function
Review Directions Changes can be reviewed in PR: #4690 Note This comment was generated via Rosetta. |
✅ Deploy Preview for finos-cdm ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| alias changeMatching: <"Locate the first PriceQuantity item where the attributes in the existing and the new price match."> | ||
| change | ||
| filter PriceUnitEquals(item, price) | ||
| filter PriceUnitEquals(item -> price only-element, price) |
There was a problem hiding this comment.
Only element is assuming the change will only have one price schedule inside it - is this intentional?
There was a problem hiding this comment.
This could be an alternative...but I haven't tested it :)
alias changeMatching:
change
filter c [
c -> price
extract PriceUnitEquals(item, price)
then only-element
]
then first
This would filter the list of changes (f) where an item in the list of prices within matches the price (and assuming there's only 1 match per change it uses only-element.)
That way if there's multiple price schedules it should still work.
The logic would return a single change with a matching price
There was a problem hiding this comment.
I've tested the new suggested approach with my test cases and it does work for those scenarios okay 👍
I will update accordingly
| extract | ||
| DatedValue { | ||
| date: item -> date, | ||
| value: if item -> date = effectiveDate |
There was a problem hiding this comment.
You could use the UpdateAmount function above and pass in item -> value, changeAmount, and the Direction as arguments.
There was a problem hiding this comment.
Same for the UpdateDatedValues function below
There was a problem hiding this comment.
Good call, I will update both the UpdateDatedValue and UpdatedDatedValues functions.
| } | ||
| else | ||
| previousDatedValue | ||
| extract |
There was a problem hiding this comment.
Very minor, but the previousDatedValue extract isn't necessary here - you can just go straight into creating the DateValue type.
There was a problem hiding this comment.
And replace item with previousDatedValue
There was a problem hiding this comment.
I had a bit of trouble with this. If I took the extract out then I was getting new DatedValue items created with the value as null. This was because where previousDatedValue was empty, the extract was catering for the fact there were no dates to loop through and thus not adding any new items. When I took the extract out, null entries started to appear.
To correct this I have updated the test on previousDatedValue to check for is absent and added a test in the else clause for previousDatedValue exists. This works okay.
|
What is being released? Changes from review comments Note This comment was generated via Rosetta. |
No description provided.