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:

  1. Trade - The top-level container for trade information

    • Contains trade date, identifiers, parties, and tradable product
  2. TradeIdentifier - Identifies the trade uniquely

    • Contains issuer, assigned identifier, and identifier type
  3. TradableProduct - Represents the tradable product in the trade

    • Contains product information, trade lots, and counterparty information
  4. ContractualProduct - Describes the contractual aspects of the product

    • Contains product taxonomy and economic terms
  5. CommodityPayout - Represents the commodity-linked leg

    • Contains commodity reference price, quantity, and settlement terms
  6. InterestRatePayout - Represents the fixed or floating rate leg

    • Contains rate specification and payment terms
  7. Observable - Defines the commodity being referenced

    • Contains commodity type, grade, and delivery location
  8. PriceQuantity - Contains pricing and quantity information

    • For commodity swaps, includes commodity price and quantity
  9. SettlementTerms - Defines settlement details

    • Contains settlement dates, currency, and calculation method
  10. CommodityReferencePrice - Specifies the commodity price reference

    • Includes commodity identifier and price source

FpML to CDM Mapping

Main Mapping Structures

FpML Element/StructureCDM Class/StructureContext
<trade>TradeTop-level trade container
<tradeHeader>Fields in TradeContains trade date and identifiers
<commoditySwap>TradableProduct with payoutsCommodity swap-specific information
<party>Party list in TradeParty information
<productType>ProductTaxonomy listProduct classification
<commodityLeg>CommodityPayoutCommodity leg details
<fixedLeg>InterestRatePayoutFixed rate leg details

Detailed Element Mapping

FpML ElementCDM FieldParent CDM ClassType
<tradeDate>tradeDate.valueTradeDate
<partyTradeIdentifier>/<issuer>tradeIdentifier[].issuer.valueTradeString
<partyTradeIdentifier>/<tradeId>tradeIdentifier[].assignedIdentifier[].identifier.valueTradeString
<party>/<partyId>party[].partyId[].identifier.valueTradeString
<party>/<partyName>party[].name.valueTradeString
<buyerPartyReference>payerReceiver.payerCommodityPayoutCounterpartyRoleEnum
<sellerPartyReference>payerReceiver.receiverCommodityPayoutCounterpartyRoleEnum
<commodity>/<commodityId>observable.commodity.commodityProductDefinition.referenceFramework.commodityNameCommodityPayoutString
<notionalQuantity>priceQuantity[].quantity[].value.valueTradeLotBigDecimal
<fixedPrice>priceQuantity[].price[].value.price.value.valueTradeLotBigDecimal
<settlementCurrency>settlementTerms.settlementCurrency.valueCommodityPayoutString
<dayCountFraction>dayCountFraction.valueInterestRatePayoutDayCountFractionEnum
<paymentFrequency>paymentDates.paymentFrequencyInterestRatePayoutFrequency

Special Considerations

Enum Mappings

The mapper handles several important enum mappings between FpML and CDM:

Day Count Fraction Mapping

FpML ValueCDM Enum Value
ACT/360DayCountFractionEnum.ACT_360
ACT/365LDayCountFractionEnum.ACT_365L
ACT/364DayCountFractionEnum.ACT_364
ACT/365.FIXEDDayCountFractionEnum.ACT_365_FIXED
ACT/ACT.AFBDayCountFractionEnum.ACT_ACT_AFB
30/360DayCountFractionEnum._30_360
30E/360DayCountFractionEnum._30E_360

Commodity Type Mapping

FpML ValueCDM Enum Value
OilCommodityTypeEnum.OIL
NaturalGasCommodityTypeEnum.NATURAL_GAS
PowerCommodityTypeEnum.POWER
CoalCommodityTypeEnum.COAL
MetalsCommodityTypeEnum.METALS

Implementation Details

  1. 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)
  2. Commodity Reference: The mapper handles different types of commodity references:

    • Physical commodities with delivery location
    • Commodity indices
    • Reference prices from pricing sources
  3. Settlement: The mapper supports different settlement types:

    • Cash settlement (most common)
    • Physical delivery (where applicable)
  4. Pricing: The mapper handles various pricing mechanisms:

    • Fixed price against floating commodity price
    • Floating commodity price against floating rate
    • Average price calculations
  5. Quantity: The mapper supports different quantity types:

    • Fixed quantity
    • Variable quantity
    • Quantity schedules