Products
Commodity - Commodity Swap (Index)
Commodity - Commodity Swap Documentation
Overview
The CommoditySwapCDMMapper class is responsible for mapping FpML (Financial Products Markup Language) commodity swaps to the ISDA Common Domain Model (CDM) format. It extends the AbstractCommodityProductsCDMMapper class, inheriting common mapping functionality for commodity products.
A commodity swap is a derivative contract where two parties exchange cash flows, with one leg typically linked to the price of a commodity, and the other leg typically linked to a fixed price or floating rate. This mapper handles the conversion of FpML XML elements representing commodity swap contracts to the corresponding CDM objects.
Key ISDA CDM Structures
The following key ISDA CDM structures are important for this mapper:
-
Trade - The top-level container for trade information
- Contains trade date, identifiers, parties, and tradable product
-
TradeIdentifier - Identifies the trade uniquely
- Contains issuer, assigned identifier, and identifier type
-
TradableProduct - Represents the tradable product in the trade
- Contains product information, trade lots, and counterparty information
-
ContractualProduct - Describes the contractual aspects of the product
- Contains product taxonomy and economic terms
-
CommodityPayout - Represents the commodity-linked leg
- Contains commodity reference price, quantity, and settlement terms
-
InterestRatePayout - Represents the fixed or floating rate leg
- Contains rate specification and payment terms
-
Observable - Defines the commodity being referenced
- Contains commodity type, grade, and delivery location
-
PriceQuantity - Contains pricing and quantity information
- For commodity swaps, includes commodity price and quantity
-
SettlementTerms - Defines settlement details
- Contains settlement dates, currency, and calculation method
-
CommodityReferencePrice - Specifies the commodity price reference
- Includes commodity identifier and price source
FpML to CDM Mapping
Main Mapping Structures
| FpML Element/Structure | CDM Class/Structure | Context |
|---|---|---|
<trade> | Trade | Top-level trade container |
<tradeHeader> | Fields in Trade | Contains trade date and identifiers |
<commoditySwap> | TradableProduct with payouts | Commodity swap-specific information |
<party> | Party list in Trade | Party information |
<productType> | ProductTaxonomy list | Product classification |
<commodityLeg> | CommodityPayout | Commodity leg details |
<fixedLeg> | InterestRatePayout | Fixed rate leg details |
Detailed Element Mapping
| FpML Element | CDM Field | Parent CDM Class | Type |
|---|---|---|---|
<tradeDate> | tradeDate.value | Trade | Date |
<partyTradeIdentifier>/<issuer> | tradeIdentifier[].issuer.value | Trade | String |
<partyTradeIdentifier>/<tradeId> | tradeIdentifier[].assignedIdentifier[].identifier.value | Trade | String |
<party>/<partyId> | party[].partyId[].identifier.value | Trade | String |
<party>/<partyName> | party[].name.value | Trade | String |
<buyerPartyReference> | payerReceiver.payer | CommodityPayout | CounterpartyRoleEnum |
<sellerPartyReference> | payerReceiver.receiver | CommodityPayout | CounterpartyRoleEnum |
<commodity>/<commodityId> | observable.commodity.commodityProductDefinition.referenceFramework.commodityName | CommodityPayout | String |
<notionalQuantity> | priceQuantity[].quantity[].value.value | TradeLot | BigDecimal |
<fixedPrice> | priceQuantity[].price[].value.price.value.value | TradeLot | BigDecimal |
<settlementCurrency> | settlementTerms.settlementCurrency.value | CommodityPayout | String |
<dayCountFraction> | dayCountFraction.value | InterestRatePayout | DayCountFractionEnum |
<paymentFrequency> | paymentDates.paymentFrequency | InterestRatePayout | Frequency |
Special Considerations
Enum Mappings
The mapper handles several important enum mappings between FpML and CDM:
Day Count Fraction Mapping
| FpML Value | CDM Enum Value |
|---|---|
ACT/360 | DayCountFractionEnum.ACT_360 |
ACT/365L | DayCountFractionEnum.ACT_365L |
ACT/364 | DayCountFractionEnum.ACT_364 |
ACT/365.FIXED | DayCountFractionEnum.ACT_365_FIXED |
ACT/ACT.AFB | DayCountFractionEnum.ACT_ACT_AFB |
30/360 | DayCountFractionEnum._30_360 |
30E/360 | DayCountFractionEnum._30E_360 |
Commodity Type Mapping
| FpML Value | CDM Enum Value |
|---|---|
Oil | CommodityTypeEnum.OIL |
NaturalGas | CommodityTypeEnum.NATURAL_GAS |
Power | CommodityTypeEnum.POWER |
Coal | CommodityTypeEnum.COAL |
Metals | CommodityTypeEnum.METALS |
Implementation Details
-
Product Taxonomy: The mapper creates appropriate product taxonomy entries based on the commodity type:
- CFI code (e.g., SCBPXX) for ISO 10962 classification
- ISDA product taxonomy (e.g., Commodity:Swap:CashSettled:SingleCommodity)
-
Commodity Reference: The mapper handles different types of commodity references:
- Physical commodities with delivery location
- Commodity indices
- Reference prices from pricing sources
-
Settlement: The mapper supports different settlement types:
- Cash settlement (most common)
- Physical delivery (where applicable)
-
Pricing: The mapper handles various pricing mechanisms:
- Fixed price against floating commodity price
- Floating commodity price against floating rate
- Average price calculations
-
Quantity: The mapper supports different quantity types:
- Fixed quantity
- Variable quantity
- Quantity schedules