From 9d50499404322380cb28dab6852e0ec59ce7e125 Mon Sep 17 00:00:00 2001 From: Jan Baserba Date: Tue, 14 Nov 2023 16:57:47 +0000 Subject: [PATCH] Forward and Option Commodity Delivery Forward and Option Commodity Delivery --- ...ml-confirmation-tradestate-synonym.rosetta | 6 ++ .../main/rosetta/product-asset-type.rosetta | 20 +++--- .../rosetta/product-template-type.rosetta | 72 +++++++++++++++++-- 3 files changed, 81 insertions(+), 17 deletions(-) diff --git a/rosetta-source/src/main/rosetta/mapping-fpml-confirmation-tradestate-synonym.rosetta b/rosetta-source/src/main/rosetta/mapping-fpml-confirmation-tradestate-synonym.rosetta index 26138bba71..0f92cd7be6 100644 --- a/rosetta-source/src/main/rosetta/mapping-fpml-confirmation-tradestate-synonym.rosetta +++ b/rosetta-source/src/main/rosetta/mapping-fpml-confirmation-tradestate-synonym.rosetta @@ -2361,6 +2361,8 @@ synonym source FpML_5_Confirmation_To_TradeState extends FpML [value "equityValuation" path "equityExercise"] + schedule [value "schedule"] + + delivery + [value "ignore"] ForwardPayout: [meta "id"] @@ -2370,6 +2372,8 @@ synonym source FpML_5_Confirmation_To_TradeState extends FpML - priceQuantity + priceQuantity [value "ignore"] + + delivery + [value "ignore"] SecurityLeg: [meta "id"] @@ -2398,6 +2402,8 @@ synonym source FpML_5_Confirmation_To_TradeState extends FpML + calculationPeriodDates [hint "calculationPeriodsSchedule"] [hint "calculationPeriods"] + + delivery + [value "ignore"] CommodityPriceReturnTerms: + spread diff --git a/rosetta-source/src/main/rosetta/product-asset-type.rosetta b/rosetta-source/src/main/rosetta/product-asset-type.rosetta index 47729fe4d3..07d5b5d877 100644 --- a/rosetta-source/src/main/rosetta/product-asset-type.rosetta +++ b/rosetta-source/src/main/rosetta/product-asset-type.rosetta @@ -25,12 +25,12 @@ type CommodityPayout extends PayoutBase: <"Payout based on the averaged price of averagingFeature AveragingCalculation (0..1) <"Indicates if the averaging calculation, when applicable, is weighted or unweighted."> commodityPriceReturnTerms CommodityPriceReturnTerms (0..1) <"Defines parameters in which the commodity price is assessed."> pricingDates PricingDates (1..1) <"Specifies specific dates or parametric rules for the dates on which the price will be determined."> - schedule CommoditySchedule (0..1) <"Allows the full representation of a commodity payout by defining a set of schedule periods. It supports standard schedule customization by expressing all the dates, quantities, and pricing data in a non-parametric way."> + schedule CalculationSchedule (0..1) <"Allows the full representation of a payout by defining a set of schedule periods. It supports standard schedule customization by expressing all the dates, quantities, and pricing data in a non-parametric way."> calculationPeriodDates CalculationPeriodDates (0..1) <"Defines the calculation period dates schedule."> paymentDates PaymentDates (1..1) <"Defines the payment date schedule, as defined by the parameters that are needed to specify it, either in a parametric way or by reference to another schedule of dates (e.g. the valuation dates)."> underlier Product (1..1) <"Identifies the underlying product that is referenced for pricing of the applicable leg in a swap. Referenced in the '2018 ISDA CDM Equity Confirmation for Security Equity Swap' as Security."> fxFeature FxFeature (0..1) <"Defines quanto or composite FX features that are included in the swap leg."> - delivery CommodityDeliveryInformation (0..1) <"Contains the information relative to the delivery of the commodity."> + delivery AssetDeliveryInformation (0..1) <"Contains the information relative to the delivery of the asset."> condition Quantity: <"When there is an OptionPayout the quantity can be expressed as part of the payoutQuantity, or as part of the underlier in the case of a Swaption. For all other payouts that extend PayoutBase the payoutQuantity is a mandatory attribute."> priceQuantity exists @@ -66,26 +66,26 @@ type CommodityPayout extends PayoutBase: <"Payout based on the averaged price of then schedule -> schedulePeriod -> deliveryPeriod -> priceTimeIntervalQuantity is absent and delivery -> periods -> profile -> block -> priceTimeIntervalQuantity is absent -type CommodityDeliveryInformation: <"Contains the information relative to the delivery of the commodity."> - periods CommodityDeliveryPeriods (0..1) <"Defines the periods of delivery, including the delivery profile."> +type AssetDeliveryInformation: <"Contains the information relative to the delivery of the asset."> + periods AssetDeliveryPeriods (0..1) <"Defines the periods of delivery, including the delivery profile."> location LocationIdentifier (0..*) <"Defines the location of the delivery of the commodity."> deliveryCapacity Quantity (0..1) <"The number of units included in the transaction for each delivery interval"> -type CommodityDeliveryPeriods: <"Defines the periods of delivery, including the delivery profile."> - profile CommodityDeliveryProfile (0..*) <"Defines the delivery profile of the commodity, including the load type and the delivery intervals."> +type AssetDeliveryPeriods: <"Defines the periods of delivery, including the delivery profile."> + profile AssetDeliveryProfile (0..*) <"Defines the delivery profile of the asset, including the load type and the delivery intervals."> startDate date (0..1) <"Delivery start date"> endDate date (0..1) <"Delivery end date"> -type CommodityScheduleDeliveryPeriods extends CommodityDeliveryPeriods: +type CalculationScheduleDeliveryPeriods extends AssetDeliveryPeriods: <"Period and time profile over which the delivery takes place."> deliveryCapacity Quantity (0..1) <"The number of units included in the transaction for each delivery interval"> priceTimeIntervalQuantity Price (0..1) <"Price per quantity per delivery time interval."> -type CommodityDeliveryProfile: <"Defines the delivery profile of the commodity, including the load type and the delivery intervals."> +type AssetDeliveryProfile: <"Defines the delivery profile of the asset, including the load type and the delivery intervals."> loadType LoadTypeEnum (0..1) <"Identification of the delivery profile."> - block CommodityDeliveryProfileBlock (0..*) <"Defines a delivery profile block, including start and end time, days of the week, duration, delivery capacity and price time interval quantity."> + block AssetDeliveryProfileBlock (0..*) <"Defines a delivery profile block, including start and end time, days of the week, duration, delivery capacity and price time interval quantity."> bankHolidaysTreatment BankHolidayTreatmentEnum (0..1) <"Specifies whether the dates defined include holidays or not."> -type CommodityDeliveryProfileBlock: +type AssetDeliveryProfileBlock: <"Defines a delivery profile block, including start and end time, days of the week, duration, delivery capacity and price time interval quantity."> startTime time (0..1) <"The start time of the delivery interval for each block or shape."> endTime time (0..1) <"The end time of the delivery interval for each block or shape."> dayOfWeek DayOfWeekEnum (0..7) <"The days of the week of the delivery."> diff --git a/rosetta-source/src/main/rosetta/product-template-type.rosetta b/rosetta-source/src/main/rosetta/product-template-type.rosetta index 58806ca96f..3147276b4f 100644 --- a/rosetta-source/src/main/rosetta/product-template-type.rosetta +++ b/rosetta-source/src/main/rosetta/product-template-type.rosetta @@ -111,7 +111,8 @@ type OptionPayout extends PayoutBase: <" The option payout specification terms. exerciseTerms OptionExercise (1..1) <"The terms for exercising the option, which include the option style (e.g. American style option), the exercise procedure (e.g. manual exercise) and the settlement terms (e.g. physical vs. cash)."> underlier Product (1..1) <"The product underlying the option, which can be of any type including ContractualProduct or Security."> observationTerms ObservationTerms (0..1) <"Class containing terms that are associated with observing a price/benchmark/index across either single or multple observations. To be used for option contracts that reference a benchmark price."> - schedule CommoditySchedule (0..1) <"Allows the full representation of a commodity payout by defining a set of schedule periods. It supports standard schedule customization by expressing all the dates, quantities, and pricing data in a non-parametric way."> + schedule CalculationSchedule (0..1) <"Allows the full representation of a payout by defining a set of schedule periods. It supports standard schedule customization by expressing all the dates, quantities, and pricing data in a non-parametric way."> + delivery AssetDeliveryInformation (0..1) <"Contains the information relative to the delivery of the asset."> condition ClearedPhysicalSettlementExists: if settlementTerms -> physicalSettlementTerms exists @@ -119,6 +120,33 @@ type OptionPayout extends PayoutBase: <" The option payout specification terms. and underlier -> contractualProduct -> economicTerms -> payout -> interestRatePayout count = 2 then settlementTerms -> physicalSettlementTerms -> clearedPhysicalSettlement exists + condition DeliveryCapacity: <"Checks that only one of the representations of delivery capacity is present simultaneously."> + if delivery -> deliveryCapacity exists + then schedule -> schedulePeriod -> deliveryPeriod -> deliveryCapacity is absent + and delivery -> periods -> profile -> block -> deliveryCapacity is absent + and schedule -> schedulePeriod -> deliveryPeriod -> profile -> block -> deliveryCapacity is absent + else if schedule -> schedulePeriod -> deliveryPeriod -> deliveryCapacity exists + then delivery -> deliveryCapacity is absent + and delivery -> periods -> profile -> block -> deliveryCapacity is absent + and schedule -> schedulePeriod -> deliveryPeriod -> profile -> block -> deliveryCapacity is absent + else if delivery -> periods -> profile -> block -> deliveryCapacity exists + then schedule -> schedulePeriod -> deliveryPeriod -> deliveryCapacity is absent + and schedule -> schedulePeriod -> deliveryPeriod -> profile -> block -> deliveryCapacity is absent + else if schedule -> schedulePeriod -> deliveryPeriod -> profile -> block -> deliveryCapacity exists + then delivery -> deliveryCapacity is absent + and schedule -> schedulePeriod -> deliveryPeriod -> deliveryCapacity is absent + and delivery -> periods -> profile -> block -> deliveryCapacity is absent + + condition PriceTimeIntervalQuantity: <"Checks that only one of the representations of price time interval quantity is present simultaneously."> + if schedule -> schedulePeriod -> deliveryPeriod -> priceTimeIntervalQuantity exists + then delivery -> periods -> profile -> block -> priceTimeIntervalQuantity is absent + and schedule -> schedulePeriod -> deliveryPeriod -> profile -> block -> priceTimeIntervalQuantity is absent + else if delivery -> periods -> profile -> block -> priceTimeIntervalQuantity exists + then schedule -> schedulePeriod -> deliveryPeriod -> priceTimeIntervalQuantity is absent + and schedule -> schedulePeriod -> deliveryPeriod -> profile -> block -> priceTimeIntervalQuantity is absent + else if schedule -> schedulePeriod -> deliveryPeriod -> profile -> block -> priceTimeIntervalQuantity exists + then schedule -> schedulePeriod -> deliveryPeriod -> priceTimeIntervalQuantity is absent + and delivery -> periods -> profile -> block -> priceTimeIntervalQuantity is absent type SecurityLeg: <" Terms defining a security leg in a securities financing transaction, which can either be the near leg or the far leg and is closely modelled onto the nearLeg and farLeg types in FpML"> [metadata key] @@ -411,6 +439,8 @@ type ForwardPayout extends PayoutBase: <"Represents a forward settling payout. T underlier Product (1..1) <"Underlying product that the forward is written on, which can be of any type: FX, a contractual product, a security, etc."> deliveryTerm string (0..1) <"Also called contract month or delivery month. However, it's not always a month. It is usually expressed using a code, e.g. Z23 would be the Dec 2023 contract, (Z = December). For crude oil, the corresponding contract might be called CLZ23."> + delivery AssetDeliveryInformation (0..1) <"Contains the information relative to the delivery of the asset."> + schedule CalculationSchedule (0..1) <"Allows the full representation of a payout by defining a set of schedule periods. It supports standard schedule customization by expressing all the dates, quantities, and pricing data in a non-parametric way."> condition SettlementTerms: <"For foreign exchange contracts, the settlement terms must exist."> if underlier -> foreignExchange exists @@ -430,21 +460,49 @@ type ForwardPayout extends PayoutBase: <"Represents a forward settling payout. T if underlier -> foreignExchange exists then settlementTerms -> physicalSettlementTerms is absent -type CommoditySchedule: <"A class that allows the full representation of a commodity payout by defining a set of schedule periods. It supports standard schedule customization by expressing all the dates, quantities, and pricing data in a non-parametric way."> - schedulePeriod SchedulePeriod (1..*) <"Defines a period of a commodity schedule structure."> - -type SchedulePeriod: <"A class that defines the commodity period of a schedule. The period contains a set of start and end dates, quantities, fixing, and pricing data."> + condition DeliveryCapacity: <"Checks that only one of the representations of delivery capacity is present simultaneously."> + if delivery -> deliveryCapacity exists + then schedule -> schedulePeriod -> deliveryPeriod -> deliveryCapacity is absent + and delivery -> periods -> profile -> block -> deliveryCapacity is absent + and schedule -> schedulePeriod -> deliveryPeriod -> profile -> block -> deliveryCapacity is absent + else if schedule -> schedulePeriod -> deliveryPeriod -> deliveryCapacity exists + then delivery -> deliveryCapacity is absent + and delivery -> periods -> profile -> block -> deliveryCapacity is absent + and schedule -> schedulePeriod -> deliveryPeriod -> profile -> block -> deliveryCapacity is absent + else if delivery -> periods -> profile -> block -> deliveryCapacity exists + then schedule -> schedulePeriod -> deliveryPeriod -> deliveryCapacity is absent + and schedule -> schedulePeriod -> deliveryPeriod -> profile -> block -> deliveryCapacity is absent + else if schedule -> schedulePeriod -> deliveryPeriod -> profile -> block -> deliveryCapacity exists + then delivery -> deliveryCapacity is absent + and schedule -> schedulePeriod -> deliveryPeriod -> deliveryCapacity is absent + and delivery -> periods -> profile -> block -> deliveryCapacity is absent + + condition PriceTimeIntervalQuantity: <"Checks that only one of the representations of price time interval quantity is present simultaneously."> + if schedule -> schedulePeriod -> deliveryPeriod -> priceTimeIntervalQuantity exists + then delivery -> periods -> profile -> block -> priceTimeIntervalQuantity is absent + and schedule -> schedulePeriod -> deliveryPeriod -> profile -> block -> priceTimeIntervalQuantity is absent + else if delivery -> periods -> profile -> block -> priceTimeIntervalQuantity exists + then schedule -> schedulePeriod -> deliveryPeriod -> priceTimeIntervalQuantity is absent + and schedule -> schedulePeriod -> deliveryPeriod -> profile -> block -> priceTimeIntervalQuantity is absent + else if schedule -> schedulePeriod -> deliveryPeriod -> profile -> block -> priceTimeIntervalQuantity exists + then schedule -> schedulePeriod -> deliveryPeriod -> priceTimeIntervalQuantity is absent + and delivery -> periods -> profile -> block -> priceTimeIntervalQuantity is absent + +type CalculationSchedule: <"A class that allows the full representation of a payout by defining a set of schedule periods. It supports standard schedule customization by expressing all the dates, quantities, and pricing data in a non-parametric way."> + schedulePeriod SchedulePeriod (1..*) <"Defines a period of a calculation schedule structure."> + +type SchedulePeriod: <"A class that defines the period of a schedule. The period contains a set of start and end dates, quantities, fixing, and pricing data."> calculationPeriod DateRange (1..1) <"Period for which the payment is generated."> paymentDate date (1..1) <"Adjusted payment date."> fixingPeriod DateRange (1..1) <"Period over which the underlying price is observed."> - deliveryPeriod CommodityScheduleDeliveryPeriods (0..1) <"Period and time profile over which the delivery takes place."> + deliveryPeriod CalculationScheduleDeliveryPeriods (0..1) <"Period and time profile over which the delivery takes place."> type FixedPricePayout extends PayoutBase: <"Represents a fixed price payout. There is no underlier associated with this payout type and is based on fixed pricing per a given unit (e.g. in commodities price per barrel)"> [metadata key] paymentDates PaymentDates (1..1) <"Specifies the parameters to generate the payment date schedule, either through a parametric representation or by reference to specified dates."> fixedPrice FixedPrice (1..1) <"Specifies the fixed price on which fixed forward payments are based."> - schedule CommoditySchedule (0..1) <"Allows the full representation of a commodity payout by defining a set of schedule periods. It supports standard schedule customization by expressing all the dates, quantities, and pricing data in a non-parametric way."> + schedule CalculationSchedule (0..1) <"Allows the full representation of a payout by defining a set of schedule periods. It supports standard schedule customization by expressing all the dates, quantities, and pricing data in a non-parametric way."> condition Quantity: <"When there is an OptionPayout the quantity can be expressed as part of the payoutQuantity, or as part of the underlier in the case of a Swaption. For all other payouts that extend PayoutBase the payoutQuantity is a mandatory attribute."> priceQuantity exists