Products
Rates - Basis Swap
Rates - Basis Swap Documentation
Overview
The IRBasisSwapCDMMapper class is responsible for mapping FpML (Financial Products Markup Language) interest rate basis swaps to the ISDA Common Domain Model (CDM) format. It extends the AbstractRateProductsCDMMapper class, inheriting common mapping functionality for interest rate products.
A basis swap involves the exchange of floating rate payments, where each leg references a different interest rate index (e.g., SOFR vs Federal Funds). This mapper handles the conversion of FpML XML elements representing basis swaps 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, trade lots, and counterparty information
-
ContractualProduct - Describes the contractual aspects of the product
- Contains product taxonomy and economic terms with payouts
-
InterestRatePayout - Represents the interest rate payout terms for each leg
- For basis swaps, there are two floating rate legs (no fixed leg)
-
FloatingRateSpecification - Contains floating rate details for each leg
- Includes rate option, index tenor, and spread information
-
CalculationPeriodDates - Defines calculation periods for the legs
- Contains effective date, termination date, and calculation period frequency
-
PaymentDates - Defines payment schedules
- Contains payment frequency, pay relative to, and adjustments
-
TradeLot - Contains pricing and quantity information
- Includes price quantities for both legs
-
PriceQuantity - Contains pricing and notional amount details
- Includes observable with rate option for the floating rates
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 |
<tradeDate> | FieldWithMetaDate in Trade | Trade execution date |
<partyTradeIdentifier> | TradeIdentifier list in Trade | Trade identifiers |
<swap> | TradableProduct in Trade | Swap-specific information |
<swapStream> (multiple) | InterestRatePayout list | Individual swap legs (both floating) |
<party> | Party list in Trade | Party information |
<productType> | ProductTaxonomy list | Product classification |
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 |
<party>/<businessUnit>/<n> | party[].businessUnit[].name | Trade | String |
<payerPartyReference> | payerReceiver.payer | InterestRatePayout | CounterpartyRoleEnum |
<receiverPartyReference> | payerReceiver.receiver | InterestRatePayout | CounterpartyRoleEnum |
<effectiveDate>/<unadjustedDate> | calculationPeriodDates.effectiveDate.adjustableDate.unadjustedDate | InterestRatePayout | Date |
<terminationDate>/<unadjustedDate> | calculationPeriodDates.terminationDate.adjustableDate.unadjustedDate | InterestRatePayout | Date |
<calculationPeriodFrequency> | calculationPeriodDates.calculationPeriodFrequency | InterestRatePayout | CalculationPeriodFrequency |
<notionalSchedule>/<notionalStepSchedule>/<initialValue> | tradeLot.priceQuantity[].quantity[].value.value | TradableProduct | BigDecimal |
<notionalSchedule>/<notionalStepSchedule>/<currency> | tradeLot.priceQuantity[].quantity[].value.unit.currency.value | TradableProduct | String |
<floatingRateCalculation>/<floatingRateIndex> | rateSpecification.floatingRate.rateOption.value.floatingRateIndex.value | InterestRatePayout | FloatingRateIndexEnum |
<floatingRateCalculation>/<indexTenor> | rateSpecification.floatingRate.rateOption.value.indexTenor | InterestRatePayout | Period |
<spreadSchedule>/<initialValue> | rateSpecification.floatingRate.spreadSchedule.price.value.value | InterestRatePayout | BigDecimal |
<dayCountFraction> | dayCountFraction.value | InterestRatePayout | DayCountFractionEnum |
<paymentFrequency> | paymentDates.paymentFrequency | InterestRatePayout | Frequency |
<resetDates> | resetDates | InterestRatePayout | ResetDates |
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 |
ACT/ACT.ICMA | DayCountFractionEnum.ACT_ACT_ICMA |
ACT/ACT.ISDA | DayCountFractionEnum.ACT_ACT_ISDA |
ACT/ACT.ISMA | DayCountFractionEnum.ACT_ACT_ISMA |
CAL/252 | DayCountFractionEnum.CAL_252 |
1/1 | DayCountFractionEnum._1_1 |
Floating Rate Index Mapping
| FpML Value | CDM Enum Value |
|---|---|
USD-Federal Funds-H.15 | FloatingRateIndexEnum.USD_FEDERAL_FUNDS_H_15 |
USD-LIBOR-BBA | FloatingRateIndexEnum.USD_LIBOR_BBA |
USD-SOFR-COMPOUND | FloatingRateIndexEnum.USD_SOFR_COMPOUND |
USD-LIBOR | FloatingRateIndexEnum.USD_LIBOR |
Implementation Details
-
Basis Swap Structure: Unlike fixed-float swaps, basis swaps involve two floating legs, each with its own floating rate index, typically with different spread values.
-
Deterministic Keys: The mapper uses a
generateDeterministicKeymethod to create consistent global keys for objects needing references:- For party references:
f78b23fbfor Party1,67e3087dfor Party2 - For trade identifiers:
5d97a672 - For trade date:
3ed88c
- For party references:
-
Payer/Receiver Pattern: For basis swaps, the mapper enforces a specific pattern:
- First leg: Party1 pays to Party2
- Second leg: Party2 pays to Party1
-
Reference Management: The implementation uses a comprehensive reference mechanism with document-scoped references:
quantity-1andquantity-2for the notional amountsprice-1andprice-2for the spreadsrateOption-1andrateOption-2for the floating rate options
-
Fallback Values: In cases where the required information is missing from the FpML, the mapper provides fallback values with appropriate warning logs.