FX - Forward

FX - Forward Documentation

Overview

The FXForwardCDMMapper class is responsible for mapping FpML (Financial Products Markup Language) foreign exchange forward contracts to the ISDA Common Domain Model (CDM) format. It extends the AbstractFXProductsCDMMapper class, inheriting common mapping functionality for FX products.

An FX forward is a contract to exchange one currency for another at a predetermined exchange rate on a specified future date. This mapper handles the conversion of FpML XML elements representing FX forward 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. FXForwardPayout - Represents the FX forward payout terms

    • Contains currency pair, exchange rate, and settlement terms
  6. CurrencyPair - Defines the currencies being exchanged

    • Contains base currency and quote currency
  7. ExchangeRate - Contains the forward exchange rate

    • Includes rate value and quotation method
  8. SettlementTerms - Defines settlement details

    • Contains settlement date, currencies, and amounts
  9. TradeLot - Contains pricing and quantity information

    • Includes price quantities for both currencies
  10. PriceQuantity - Contains pricing and amount details

    • Includes observable with exchange rate

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
<tradeDate>FieldWithMetaDate in TradeTrade execution date
<partyTradeIdentifier>TradeIdentifier list in TradeTrade identifiers
<fxForward>TradableProduct with FXForwardPayoutFX forward-specific information
<party>Party list in TradeParty information
<productType>ProductTaxonomy listProduct classification
<settlementTerms>SettlementTerms in FXForwardPayoutSettlement 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.payerFXForwardPayoutCounterpartyRoleEnum
<sellerPartyReference>payerReceiver.receiverFXForwardPayoutCounterpartyRoleEnum
<valueDate>settlementTerms.settlementDateFXForwardPayoutDate
<currency1>currencyPair.baseCurrency.valueFXForwardPayoutString
<currency2>currencyPair.quoteCurrency.valueFXForwardPayoutString
<exchangeRate>exchangeRate.rate.valueFXForwardPayoutBigDecimal
<amount1>priceQuantity[0].quantity[].value.valueTradeLotBigDecimal
<amount2>priceQuantity[1].quantity[].value.valueTradeLotBigDecimal
<settlementType>settlementTerms.settlementTypeFXForwardPayoutSettlementTypeEnum
<settlementCurrency>settlementTerms.settlementCurrency.valueFXForwardPayoutString

Special Considerations

Enum Mappings

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

Settlement Type Mapping

FpML ValueCDM Enum Value
RegularSettlementTypeEnum.REGULAR
CashSettlementTypeEnum.CASH
PhysicalSettlementTypeEnum.PHYSICAL

Counterparty Role Mapping

FpML ValueCDM Enum Value
PARTY1CounterpartyRoleEnum.PARTY_1
PARTY2CounterpartyRoleEnum.PARTY_2

Implementation Details

  1. Currency Pair: The mapper creates a CurrencyPair object with base and quote currencies, following standard FX market conventions.

  2. Exchange Rate: The exchange rate is stored as a PriceQuantity with an observable containing the rate value.

  3. Settlement: The mapper handles different settlement types:

    • Regular settlement (standard FX forward)
    • Cash settlement (NDF - Non-Deliverable Forward)
    • Physical settlement (standard FX forward)
  4. Amounts: The mapper handles both currency amounts:

    • Base currency amount
    • Quote currency amount (calculated using the exchange rate)
  5. Global Keys: The mapper uses specific global keys for common objects:

    • Trade date: 3f28c9
    • Trade identifier: f3ebf782
    • Party references: f78b23fb for Party1, 67e3087d for Party2