Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into jbaserba_Jan_Base…
Browse files Browse the repository at this point in the history
…rba_Commodity_Delivery_Option_Forward_updated
  • Loading branch information
davidalk committed Nov 14, 2023
2 parents 9d50499 + a570f5c commit 7515cb2
Show file tree
Hide file tree
Showing 31 changed files with 4,453 additions and 3,510 deletions.
57 changes: 21 additions & 36 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,36 @@
# *Exchange Traded Positions Model*
# *Rename product qualification for Securities Lending and Repo*

_Background_

The CDM model does not currently support exchange traded positions within its framework. To that end, a collaborative effort has been made to model them within the framework of the CDM. This initiative has been a collective endeavor, drawing upon the expertise of SMEs. The primary objective has been to establish a representation of Exchange Traded Positions that aligns with the broader CDM. A working model has been reached which gathers consensus among member firms, and entails the creation of a root type `CounterpartyPositionState`, and a new type `CounterpartyPositionBusinessEvent` within the already existing `WorkflowStep` to document the state transition of a counterparty position in CDM.
The current product qualification rules do not distinguish between securities lending and repurchase agreement product types. A future enhancement will refactor how `product` works and also introduce additional capabilities to the qualification functions to use additional attributes to support finer grained qualification (see Issue #2365).

In the meantime, the current qualification rule for repurchase agreements - which is invoked also for securities lending products - will be renamed to be "SecuritiesFinancing" to more loosely differentiate both sets of products.

_What is being released?_

- Support for exchange traded positions to CDM Core.
- An updated product qualification rule: `Qualify_RepurchaseAgreement` is renamed to `Qualify_SecuritiesFinancing`.

_Data types_

- Added new `CounterpartyPositionState` root type.
- `counterpartyPosition` attribute of type `CounterpartyPosition` added to `CounterpartyPositionState` type.
- `state` attribute of type `State` added to `CounterpartyPositionState` type.
- `observationHistory` attribute of type `ObservationEvent` added to `CounterpartyPositionState` type.
- `valuationHistory` attribute of type `Valuation` added to `CounterpartyPositionState` type.
- Added new `CounterpartyPositionBusinessEvent` type.
- `intent` attribute of type `PositionEventIntentEnum` added to `CounterpartyPositionBusinessEvent` type.
- `corporateActionIntent` attribute of type `CorporateActionTypeEnum` added to `CounterpartyPositionBusinessEvent` type.
- `eventDate` attribute of type `date` added to `CounterpartyPositionBusinessEvent` type.
- `effectiveDate` attribute of type `date` added to `CounterpartyPositionBusinessEvent` type.
- `packageInformation` attribute of type `IdentifiedList` added to `CounterpartyPositionBusinessEvent` type.
- `after` attribute of type `CounterpartyPositionState` added to `CounterpartyPositionBusinessEvent` type.
- Added new `PositionIdentifier` type.
- `identifierType` attribute of type `PositionIdentifierTypeEnum` added to `PositionIdentifier` type.
- `valuationTiming` attribute of type `PriceTimingEnum` added to `Valuation` type.
- `priceComponent` attribute of type `Price` added to `Valuation` type.
- `counterpartyPositionBusinessEvent` attribute of type `CounterpartyPositionBusinessEvent` added to `WorkflowStep` type.
- Added new `ContractBase` type.
- `contractDetails` attribute of type `ContractDetails` added to `ContractBase` type.
- `executionDetails` attribute of type `ExecutionDetails` added to `ContractBase` type.
- `collateral` attribute of type `Collateral` added to `ContractBase` type.
- Added new `CounterpartyPosition` type.
- `positionIdentifier` attribute of type `PositionIdentifier` added to `CounterpartyPosition` type.
- `openDateTime` attribute of type `dateTime` added to `CounterpartyPosition` type.
- `tradeReference` attribute of type `TradeState` added to `CounterpartyPosition` type.
- `party` attribute of type `Party` added to `CounterpartyPosition` type.
- `partyRole` attribute of type `PartyRole` added to `CounterpartyPosition` type.
- `positionBase` attribute of type `TradableProduct` added to `CounterpartyPosition` type.
- Added condition `CounterpartyPositionBusinessEventOrBusinessEventChoice` to `WorkflowStep` type.
- Added `[metadata key]` to `Collateral` type.
No changes.

_Enumerations_

- Added new `PositionEventIntentEnum` enumeration.
- Added new `PriceTimingEnum` enumeration.
No changes.

_Sample Files_

The following JSON sample files have been updated to reflect the current modeling of securities lending products which is to have the collateral information inside the `Collateral` data type rather than inside `AssetPayout`.

- create-security-lending-invoice-func-input.json
- full-return-settlement-workflow-func-input.json
- new-settlement-workflow-func-input.json
- new-settlement-workflow-func-input.json
- allocation/allocation-sec-lending-func-input.json
- reallocation/reallocation-pre-settled-func-input.json

_Review directions_

In the CDM Portal, select the Textual Browser and inspect each of the changes listed above.
In the CDM Portal, select the Textual Browser and inspect each of the changes identified above.

Changes can be reviewed in PR: https://github.com/finos/common-domain-model/pull/2456
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,13 @@ private PathValue<EconomicTermsBuilder> getEcTerms(PathValue<TradeStateBuilder>

private PathValue<AssetPayout.AssetPayoutBuilder> getSecPO(PathValue<TradeStateBuilder> ts) {
PathValue<EconomicTermsBuilder> et = getEcTerms(ts);
return new PathValue<>(et.getModelPath().addElement("payout").addElement("securityFinancePayout", 0),
et.getValue().getOrCreatePayout().getOrCreateAssetPayout(0));
return new PathValue<>(et.getModelPath().addElement("collateral").addElement("collateralPortfolio", 0)
.addElement("collateralPosition", 0).addElement("product")
.addElement("contractualProduct").addElement("economicTerms")
.addElement("payout").addElement("assetPayout", 0),
et.getValue().getOrCreateCollateral().getOrCreateCollateralPortfolio(0).getOrCreateValue()
.getOrCreateCollateralPosition(0).getOrCreateProduct().getOrCreateContractualProduct()
.getOrCreateEconomicTerms().getOrCreatePayout().getOrCreateAssetPayout(0));
}

private PathValue<CollateralProvisions.CollateralProvisionsBuilder> getColPro(PathValue<TradeStateBuilder> ts) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
import cdm.event.common.functions.CalculateTransfer;
import cdm.event.common.functions.Create_BusinessEvent;
import cdm.event.common.functions.Create_Return;
import cdm.event.common.metafields.ReferenceWithMetaCollateralPortfolio;
import cdm.event.workflow.EventInstruction;
import cdm.product.collateral.Collateral;
import cdm.product.template.*;
import com.google.common.collect.Iterables;
import com.rosetta.model.lib.RosettaModelObject;
Expand All @@ -21,9 +23,7 @@

import javax.inject.Inject;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -171,7 +171,17 @@ private Optional<Payout> getPayout(BusinessEvent executionBusinessEvent) {
.map(TradableProduct::getProduct)
.map(Product::getContractualProduct)
.map(ContractualProduct::getEconomicTerms)
.map(EconomicTerms::getPayout);
.map(EconomicTerms::getCollateral)
.map(Collateral::getCollateralPortfolio)
.orElse(Collections.emptyList()).stream()
.map(ReferenceWithMetaCollateralPortfolio::getValue)
.map(CollateralPortfolio::getCollateralPosition)
.flatMap(Collection::stream)
.map(CollateralPosition::getProduct)
.map(Product::getContractualProduct)
.map(ContractualProduct::getEconomicTerms)
.map(EconomicTerms::getPayout)
.findFirst();
}

private Optional<Payout> getSecurityPayout(BusinessEvent executionBusinessEvent) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[
{"fileName":"cdm-sample-files/fis/isla1.xml","excludedPaths":0,"externalPaths":120,"outstandingMappings":10,"validationFailures":37,"qualificationExpectation":{"success":false,"qualifyResults":[{"qualifiedName":"SecurityLendingAgreement","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecurityLendingAgreement","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecurityLendingAgreement","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecurityLendingAgreement","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecurityLendingAgreement","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecurityLendingAgreement","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":7}}]
{"fileName":"cdm-sample-files/fis/isla1.xml","excludedPaths":0,"externalPaths":120,"outstandingMappings":10,"validationFailures":37,"qualificationExpectation":{"success":false,"qualifyResults":[{"qualifiedName":"SecuritiesFinance","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecuritiesFinance","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecuritiesFinance","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecuritiesFinance","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecuritiesFinance","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecuritiesFinance","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":13}}]
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -398,7 +398,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -827,7 +827,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -1255,7 +1255,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -572,7 +572,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -996,7 +996,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -1420,7 +1420,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -465,7 +465,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -909,7 +909,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -1358,7 +1358,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -317,7 +317,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -746,7 +746,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -1174,7 +1174,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -503,7 +503,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -908,7 +908,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -1396,7 +1396,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -1825,7 +1825,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -2301,7 +2301,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -452,7 +452,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -398,7 +398,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -826,7 +826,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -1254,7 +1254,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down
Loading

0 comments on commit 7515cb2

Please sign in to comment.