Skip to content

Commit

Permalink
Lionel Smith-Gordon Refactor ETD qualification (P3+) - Release (#3200)
Browse files Browse the repository at this point in the history
* Refactor ETD qualification (P3+)

Refactor product qualification for ETDs (ART P3+)

* correct typo

correct typo

* typo

typo

* release note

* update expectations

* update expectations

* update expectations

* update expectations

* update expectations

* update expectations

* update tests and expectations

* Reinstated ETD enum and added mappings

To address ETD product qualification exceptions

* update expectations

* update RN

* Fix instrumentType mappings for loans and listed derivatives

* Update expectations

* Reduce logging

* update expectations

---------

Co-authored-by: Lionel Smith-Gordon <lionel@oblongs.uk>
Co-authored-by: Lionel SG <146734978+Oblongs@users.noreply.github.com>
Co-authored-by: PayalKhanna <payal.khanna@regnosys.com>
Co-authored-by: hugohills-regnosys <hugo.hills@regnosys.com>
  • Loading branch information
5 people authored Nov 1, 2024
1 parent 691504f commit cd9644e
Show file tree
Hide file tree
Showing 333 changed files with 1,315 additions and 1,601 deletions.
28 changes: 27 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,30 @@ _Backward-incompatible changes_

This release contains changes that are not backward-compatible:
- All references to a payout need to be updated as references to a payout are now treated as capitalised Data Types rather than lower case Attributes. For example, a previous reference might have read: `payout -> interestRatePayout -> floatingAmount` must now be written as: `payout -> InterestRatePayout -> floatingAmount`.
- Logic or mapping that expects certain cardinality may need to be reviewed; see the explanation above.
- Logic or mapping that expects certain cardinality may need to be reviewed; see the explanation above.

# *CDM Product Model* - Refactor ETD Product Qualification

_Background_

In an earlier Asset Refactoring release, the modelling of Exchange Traded Derivatives was enhanced
by introducing a new item `ListedDerivative` as an option of one of the values in the `Asset` choice
data type. However, the product qualification functions were still expecting these products to be
modelled using the `Security` choice within `Asset`. This has been corrected.
The enumerator type `SecurityTypeEnum` has been renamed to `InstrumentTypeEnum` and the value of
`ListedDerivative` has been removed from the list. This broadens the potential use of this
enumeration for additional assets.

The attribute `instrumentType`, using the `InstrumentTypeEnum` data type, has been added to `InstrumentBase`
so that this basic type determination is on all types of instrument. The corresponding attribute,
`securityType` has been removed from `Security` to avoid duplication.

The attribute `securityType` on the data type `AssetType` has been changed to use the renamed data
type, ie `InstrumentTypeEnum`.

Occurrences of logic to test the type of a security or instrument
have also been updated to use this new name `InstrumentTypeEnum`, including a number of references
to this enumerator in the product qualification logic. Where product qualification was only
looking for the type of a `security`, it has also been broadened to `instrument`.

Changes can be reviewed in PR [#3200](https://github.com/finos/common-domain-model/pull/3200)
33 changes: 16 additions & 17 deletions docs/product-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -1105,23 +1105,22 @@ ISDA definitions for reference benchmarks. Security has a
set of additional attributes, as shown below:

``` Haskell
type Security extends InstrumentBase:
securityType SecurityTypeEnum (1..1)
debtType DebtType (0..1)
equityType EquityTypeEnum (0..1)
fundType FundProductTypeEnum (0..1)

condition DebtSubType:
if securityType <> SecurityTypeEnum -> Debt
then debtType is absent

condition EquitySubType:
if securityType <> SecurityTypeEnum -> Equity
then equityType is absent

condition FundSubType:
if securityType <> SecurityTypeEnum -> Fund
then fundType is absent
type Security extends InstrumentBase:
debtType DebtType (0..1)
equityType EquityTypeEnum (0..1)
fundType FundProductTypeEnum (0..1)

condition DebtSubType:
if instrumentType <> InstrumentTypeEnum -> Debt
then debtType is absent

condition EquitySubType:
if instrumentType <> InstrumentTypeEnum -> Equity
then equityType is absent

condition FundSubType:
if instrumentType <> InstrumentTypeEnum -> Fund
then fundType is absent
```

The product identifier will uniquely identify the security. The
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private static EligibleCollateralCriteria getCommonCriteria() {
.addAsset(AssetCriteria.builder()
.addCollateralAssetType(AssetType.builder()
.setAssetType(AssetTypeEnum.SECURITY)
.setSecurityType(SecurityTypeEnum.DEBT)))
.setSecurityType(InstrumentTypeEnum.DEBT)))
.addIssuer(IssuerCriteria.builder()
.addIssuerType(CollateralIssuerType.builder()
.setIssuerType(IssuerTypeEnum.SOVEREIGN_CENTRAL_BANK))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import cdm.base.math.UnitType;
import cdm.base.staticdata.asset.common.AssetIdTypeEnum;
import cdm.base.staticdata.asset.common.AssetIdentifier;
import cdm.base.staticdata.asset.common.InstrumentTypeEnum;
import cdm.base.staticdata.asset.common.Security;
import cdm.base.staticdata.asset.common.SecurityTypeEnum;
import cdm.base.staticdata.party.CounterpartyRoleEnum;
import cdm.base.staticdata.party.PartyIdentifier;
import cdm.event.common.ExecutionTypeEnum;
Expand Down Expand Up @@ -94,7 +94,7 @@ private void staticMappings(PathValue<TradeStateBuilder> tradeState) {
getIRP(tradeState).getValue().getOrCreatePaymentDates().getOrCreatePaymentFrequency().setPeriodMultiplier(1);

//sec lending payout
getSecPO(tradeState).getValue().getOrCreateUnderlier().getOrCreateInstrument().getOrCreateSecurity().setSecurityType(SecurityTypeEnum.EQUITY);
getSecPO(tradeState).getValue().getOrCreateUnderlier().getOrCreateInstrument().getOrCreateSecurity().setInstrumentType(InstrumentTypeEnum.EQUITY);

getSecPO(tradeState).getValue().getOrCreatePayerReceiver().setPayer(CounterpartyRoleEnum.PARTY_1);
getSecPO(tradeState).getValue().getOrCreatePayerReceiver().setReceiver(CounterpartyRoleEnum.PARTY_2);
Expand Down Expand Up @@ -338,7 +338,7 @@ private Multimap<String, MappingConsumer<TradeStateBuilder>> buildCommonMappings
// key
PathValue<PriceQuantityBuilder> pq = getPriceQuantityForSecurityFinancePayout(tradeState);
Security security = Security.builder()
.setSecurityType(SecurityTypeEnum.EQUITY)
.setInstrumentType(InstrumentTypeEnum.EQUITY)
.addIdentifier(AssetIdentifier.builder()
.setIdentifierValue(value)
.setIdentifierType(AssetIdTypeEnum.SEDOL));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
},
"identifierType" : "ISIN"
} ],
"securityType" : "Debt"
"instrumentType" : "Debt"
},
"primaryObligorReference" : {
"globalReference" : "e414546d",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
},
"identifierType" : "ISIN"
} ],
"securityType" : "Debt"
"instrumentType" : "Debt"
},
"primaryObligorReference" : {
"globalReference" : "e414546d",
Expand Down Expand Up @@ -704,7 +704,7 @@
},
"identifierType" : "ISIN"
} ],
"securityType" : "Debt"
"instrumentType" : "Debt"
},
"primaryObligorReference" : {
"globalReference" : "e414546d",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
},
"identifierType" : "ISIN"
} ],
"securityType" : "Debt"
"instrumentType" : "Debt"
},
"primaryObligorReference" : {
"globalReference" : "e414546d",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
},
"identifierType" : "ISIN"
} ],
"securityType" : "Debt"
"instrumentType" : "Debt"
},
"primaryObligorReference" : {
"globalReference" : "e414546d",
Expand Down Expand Up @@ -634,7 +634,7 @@
},
"identifierType" : "ISIN"
} ],
"securityType" : "Debt"
"instrumentType" : "Debt"
},
"primaryObligorReference" : {
"globalReference" : "e414546d",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down Expand Up @@ -1231,7 +1231,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down Expand Up @@ -750,7 +750,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down Expand Up @@ -752,7 +752,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down Expand Up @@ -1466,7 +1466,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down Expand Up @@ -1642,7 +1642,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
},
"identifierType" : "Other"
} ],
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down Expand Up @@ -657,7 +657,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
},
"identifierType" : "Other"
} ],
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down Expand Up @@ -654,7 +654,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down Expand Up @@ -1369,7 +1369,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down Expand Up @@ -1513,7 +1513,7 @@
},
"identifierType" : "Other"
} ],
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down Expand Up @@ -709,7 +709,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down Expand Up @@ -722,7 +722,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down Expand Up @@ -1436,7 +1436,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down Expand Up @@ -1612,7 +1612,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down Expand Up @@ -1173,7 +1173,7 @@
"globalKey" : "247344"
}
},
"securityType" : "Equity"
"instrumentType" : "Equity"
}
}
}
Expand Down
Loading

0 comments on commit cd9644e

Please sign in to comment.