# FpML 4.5 Validation Rules - Rules for Interest Rate Derivatives (IRD)

This is the Interest Rate Derivatives part of the validation rule set accompanying the FpML 4.5 Working Draft. The introductory section in the draft contains background information and documentation for this page.

The rules contained on this page contain links to cut down versions of valid and invalid test cases. These test cases have been analysed using Systemwire's xlinkit rule engine to highlight relevant document portions accessed by a rule. The cut down test cases are non-normative and are provided for the purpose of documentation only.

## Content

- Definitions
  - regular period
  - frequency equivalence
  - unadjusted calculation period dates
  - the schedule implied by
- Namespace
- Conditions
- Functions
- Rules
- Rules with comments
  - ird-1
  - ird-7
  - ird-24
  - ird-49
  - ird-50
  - ird-51
  - ird-52
  - ird-53
  - ird-54

## Namespace

default element namespace = http://www.fpml.org/2008/FpML-4-5

## Definitions

Term: regular period
The regular period of a set of calculation period dates is the period between a start date and an end date. If firstRegularPeriodStartDate exists, then the start date is firstRegularPeriodStartDate, else the start date is effectiveDate/unadjustedDate. If lastRegularPeriodEndDate exists, then the end date is lastRegularPeriodEndDate, else the end date is terminationDate/unadjustedDate.
Term: frequency equivalence
A frequency is specified as a tuple of period, which is an integer, and periodMultiplier, which is one of D, M, Y, W or T, standing for day, month, year, week and term. Between any pair of frequencies, the following is the complete list of equivalences where the period multipliers differ:

- 12M=1Y
- 7D=1W

iff(period elements are equal, If the period multipliers of a pair of frequencies are equivalent then they are equal). For the purpose of calculating multiples of periods, the following additional rule holds:

- Any frequency > 0 is a multiple of 1D
- 1T is a positive integer multiple (>= 1) of any frequency

Term: unadjusted calculation period dates
This applies in the context of an InterestRateStream. For the purpose of validation, the unadjusted calculation period dates are determined as follows:

- cashflows element not present: the unadjusted calculation period dates are calculated by stepping through the regular period at the frequency specified in calculationPeriodDates/calculationPeriodFrequency. The first date is the start date of the regular period and the last date is the end date of the regular period.
- cashflows element exists and cashflowsMatchParameters is true: the unadjusted calculation period dates are calculated from the regular period as in the previous case.
- cashflows element exists and cashflowsMatchParameters is false: rules that relate elements to unadjusted calculation period dates do not apply. Instead, the cash flows must be validated internally.

Term: the schedule implied by
The schedule defined by the effective- and termination-Date, together with the "RegularPeriod" dates which may appear optionally in the presence of stubs, and the calculation period frequency.

## Conditions

The Validation Conditions only apply when specific rules reference them. The following conditions are always to be executed relative to the root of the FpML document being validated. The context of the rule is NOT carried through to the condition.

Condition: isFloating
(context: InterestRateStream) resetDates exists.
Condition: isParametric
(context: InterestRateStream) If cashflows does not exist , or cashflows/cashflowsMatchParameters is true.
Condition: hasInitialStub
(context: InterestRateStream) paymentDates/firstPaymentDate exists.

## Functions

The following shared functions are used in the rules.

- iff
- different-frequencies

## Rules

#### Unique contexts:

- InterestRateStream (complex type): ird-1 ird-2 ird-3 ird-4 ird-5 ird-6 ird-7 ird-8 ird-9 ird-50 ird-51 ird-52 ird-53 ird-54 ird-55 ird-56
- CalculationPeriodDates (complex type): ird-10 ird-11 ird-12 ird-14 ird-15 ird-16 ird-17 ird-18 ird-19 ird-20 ird-21 ird-22
- StubCalculationPeriodAmount (complex type): ird-23 ird-24 ird-38
- Schedule (complex type): ird-25
- BusinessCentersReference (complex type): ird-26
- MandatoryEarlyTermination (complex type): ird-27 ird-28
- Calculation (complex type): ird-29
- CalculationPeriod (complex type): ird-30 ird-31
- Discounting (complex type): ird-32
- Fra (complex type): ird-33
- PaymentCalculationPeriod (complex type): ird-34
- PaymentDates (complex type): ird-35 ird-36
- EarlyTerminationEvent (complex type): ird-39 ird-40 ird-41
- ExtensionEvent (complex type): ird-42
- FxLinkedNotionalAmount (complex type): ird-43
- MandatoryEarlyTerminationAdjustedDates (complex type): ird-44
- OptionalEarlyTermination (complex type): ird-46 ird-47
- Swaption (complex type): ird-48
- ResetFrequency (complex type): ird-49
- CalculationPeriodFrequency (complex type): ird-57 ird-58
- ResetDates (complex type): ird-59
- Deprecated rules
- Removed rules

ird-1 (Mandatory)
Context: InterestRateStream (complex type)
iff(exist resetDates, floatingRateCalculation or inflationRateCalculation exists in the calculationPeriodAmount/calculation element).
Comment: resetDates must exist if and only if a floatingRateCalculation or inflationRateCalculation exists in the calculationPeriodAmount/calculation element.
Test cases: [Valid] [Valid] [Invalid] [Invalid] [Invalid] [Invalid]
ird-2 (Mandatory)
Context: InterestRateStream (complex type)
[isParametric]
paymentDates/paymentFrequency = an integer multiple (could be 1) of calculationPeriodDates/calculationPeriodFrequency. See also: frequency equivalence.
Test cases: [Valid] [Valid] [Valid] [Invalid] [Invalid]
ird-3 (Mandatory)
Context: InterestRateStream (complex type)
[isParametric]
paymentDates/firstPaymentDate = one of the unadjusted calculation period dates.
Test cases: [Valid] [Valid] [Valid] [Invalid] [Invalid] [Invalid]
ird-4 (Mandatory)
Context: InterestRateStream (complex type)
[isParametric]
paymentDates/lastRegularPaymentDate = one of the unadjusted calculation period dates
Test cases: [Valid] [Valid] [Valid] [Invalid] [Invalid] [Invalid] [Invalid]
ird-5 (Mandatory)
Context: InterestRateStream (complex type)
[(cashflows/cashflowsMatchParameters = true) or (not(exists(cashflows)))] [exists(resetDates)]
The frequency in calculationPeriodDates/calculationPeriodFrequency must be an integer multiple of the frequency in resetDates/resetFrequency. See also: frequency equivalence
Test cases: [Valid] [Valid] [Invalid] [Invalid]
ird-6 (Mandatory)
Context: InterestRateStream (complex type)
[isParametric] [exists(paymentDates/firstPaymentDate)] [exists(calculationPeriodDates/effectiveDate)]
paymentDates/firstPaymentDate > calculationPeriodDates/effectiveDate/unadjustedDate.
Test cases: [Valid] [Invalid]
ird-7 (Mandatory)
Context: InterestRateStream (complex type)
[isParametric]
iff(exist calculationPeriodAmount/calculation/compoundingMethod, different-frequencies((paymentDates/paymentFrequency, calculationPeriodDates/calculationPeriodFrequency))). See also: frequency equivalence.
Comment: calculationPeriodAmount/calculation/compoundingMethod exists if and only if the frequencies in paymentDates/paymentFrequency and calculationPeriodDates/calculationPeriodFrequency are different.
Test cases: [Valid] [Valid] [Invalid] [Invalid]
ird-8 (Mandatory)
Context: InterestRateStream
payerPartyReference/@href != receiverPartyReference/@href.
Test cases: [Valid] [Invalid]
ird-9 (Mandatory)
Context: InterestRateStream (complex type)
[exists(calculationPeriodAmount/calculation/compoundingMethod)]
resetDates must exist.
Test cases: [Valid] [Invalid]
ird-10 (Mandatory)
Context: CalculationPeriodDates (complex type)
[isParametric] [calculationPeriodFrequency/rollConvention is a number]
If firstRegularPeriodStartDate exists, then the start date is firstRegularPeriodStartDate, else the start date is effectiveDate/unadjustedDate. If calculationPeriodFrequency/rollConvention is less than or equal to the last day of the month in the start date, then the day of the start date must match it, else the day of the start date must be the last day of the month of that date.
Test cases: [Valid] [Valid] [Valid] [Valid] [Valid] [Invalid] [Invalid] [Invalid] [Invalid]
ird-11 (Mandatory)
Context: CalculationPeriodDates (complex type)
[isParametric] [calculationPeriodFrequency/rollConvention is a number]
If lastRegularPeriodEndDate exists, then the end date is lastRegularPeriodEndDate, else the end date is terminationDate/unadjustedDate. If calculationPeriodFrequency/rollConvention is less than or equal to the last day of the month in the end date, then the day of the end date must match it, else the day of the end date must be the last day of the month of that date.
Test cases: [Valid] [Valid] [Valid] [Valid] [Valid] [Invalid] [Invalid] [Invalid] [Invalid] [Invalid]
ird-12 (Mandatory)
Context: CalculationPeriodDates (complex type)
[isParametric]
The frequency specified in calculationPeriodFrequency must divide the regular period precisely. This means that by stepping through the period from the start date at the specified frequency, it must be possible to reach the end date.
Test cases: [Valid] [Valid] [Valid] [Valid] [Invalid] [Invalid] [Invalid] [Invalid] [Invalid] [Invalid]
ird-14 (Mandatory)
Context: CalculationPeriodDates (complex type)
[isParametric]
terminationDate/unadjustedDate > effectiveDate/unadjustedDate.
Test cases: [Valid] [Invalid] [Invalid]
ird-15 (Mandatory)
Context: CalculationPeriodDates (complex type)
[isParametric]
terminationDate/unadjustedDate > firstPeriodStartDate/unadjustedDate.
Test cases: [Valid] [Invalid] [Invalid]
ird-16 (Mandatory)
Context: CalculationPeriodDates (complex type)
[isParametric]
terminationDate/unadjustedDate > firstRegularPeriodStartDate.
Test cases: [Valid] [Invalid] [Invalid]
ird-17 (Mandatory)
Context: CalculationPeriodDates (complex type)
[isParametric]
terminationDate/unadjustedDate > lastRegularPeriodEndDate.
Test cases: [Valid] [Invalid]
ird-18 (Mandatory)
Context: CalculationPeriodDates (complex type)
[isParametric]
lastRegularPeriodEndDate > firstRegularPeriodStartDate.
Test cases: [Valid] [Invalid] [Invalid]
ird-19 (Mandatory)
Context: CalculationPeriodDates (complex type)
[isParametric]
lastRegularPeriodEndDate > firstPeriodStartDate/unadjustedDate.
Test cases: [Valid] [Invalid] [Invalid]
ird-20 (Mandatory)
Context: CalculationPeriodDates (complex type)
[isParametric]
lastRegularPeriodEndDate > effectiveDate/unadjustedDate.
Test cases: [Valid] [Invalid]
ird-21 (Mandatory)
Context: CalculationPeriodDates (complex type)
[isParametric]
firstPeriodStartDate/unadjustedDate < effectiveDate/unadjustedDate.
Test cases: [Valid] [Invalid] [Invalid]
ird-22 (Mandatory)
Context: CalculationPeriodDates (complex type)
[isParametric]
firstPeriodStartDate/unadjustedDate < firstRegularPeriodStartDate.
Test cases: [Valid] [Invalid] [Invalid]
ird-23 (Mandatory)
Context: StubCalculationPeriodAmount (complex type)
iff(exist initialStub, calculationPeriodDates element referenced by calculationPeriodDates/@href contains at least one of:

- firstPeriodStartDate
- firstRegularPeriodStartDate

).
Test cases: [Valid] [Valid] [Invalid]
ird-24 (Mandatory)
Context: StubCalculationPeriodAmount (complex type)
iff(exist finalStub, calculationPeriodDates element referenced by calculationPeriodDates/@href contains a lastRegularPeriodEndDate element).
Comment: finalStub exists if and only if the calculationPeriodDates element referenced by calculationPeriodDates/@href contains a lastRegularPeriodEndDate element.
Test cases: [Valid] [Invalid]
ird-25 (Mandatory)
Context: Schedule (complex type)
[not(exists(step))]
initialValue not equal to zero.
Test cases: [Valid] [Valid] [Invalid]
ird-27 (Mandatory)
Context: MandatoryEarlyTermination (complex type)
cashSettlement/cashSettlementPaymentDate must not exist.
Test cases: [Valid] [Invalid]
ird-29 (Mandatory)
Context: Calculation (complex type)
[exists(compoundingMethod)]
fixedRateSchedule must not exist.
Test cases: [Valid] [Invalid]
ird-30 (Mandatory)
Context: CalculationPeriod (complex type)
Must contain unadjustedStartDate and/or adjustedStartDate.
Test cases: [Valid] [Valid] [Invalid]
ird-31 (Mandatory)
Context: CalculationPeriod (complex type)
Must contain unadjustedEndDate and/or adjustedEndDate.
Test cases: [Valid] [Valid] [Invalid]
ird-33 (Mandatory)
Context: Fra (complex type)
adjustedTerminationDate> adjustedEffectiveDate.
Test cases: [Valid] [Invalid]
ird-34 (Mandatory)
Context: PaymentCalculationPeriod (complex type)
Either unadjustedPaymentDate or adjustedPaymentDate must exist.
Test cases: [Valid] [Valid] [Invalid]
ird-35 (Mandatory)
Context: PaymentDates (complex type)
[exists(firstPaymentDate)] [exists(lastRegularPaymentDate)]
firstPaymentDate < lastRegularPaymentDate.
Test cases: [Valid] [Invalid] [Invalid]
ird-36 (Mandatory)
Context: PaymentDates (complex type)
[exists(firstPaymentDate)] [exists(lastRegularPaymentDate)]
The period defined by the dates firstPaymentDate and lastRegularPaymentDate must be an integer multiple of paymentFrequency.
Test cases: [Valid] [Invalid]
ird-39 (Mandatory)
Context: EarlyTerminationEvent (complex type)
adjustedExerciseDate <= adjustedEarlyTerminationDate.
Test cases: [Valid] [Valid] [Invalid]
ird-40 (Mandatory)
Context: EarlyTerminationEvent (complex type)
adjustedExerciseDate <= adjustedCashSettlementValuationDate.
Test cases: [Valid] [Valid] [Invalid]
ird-41 (Mandatory)
Context: EarlyTerminationEvent (complex type)
adjustedCashSettlementValuationDate <= adjustedCashSettlementPaymentDate.
Test cases: [Valid] [Valid] [Invalid]
ird-42 (Mandatory)
Context: ExtensionEvent (complex type)
adjustedExerciseDate < adjustedExtendedTerminationDate.
Test cases: [Valid] [Invalid] [Invalid]
ird-43 (Mandatory)
Context: FxLinkedNotionalAmount (complex type)
At least one element must exist.
Test cases: [Valid] [Invalid]
ird-44 (Mandatory)
Context: MandatoryEarlyTerminationAdjustedDates (complex type)
adjustedEarlyTerminationDate <= adjustedCashSettlementValuationDate <= adjustedCashSettlementPaymentDate.
Test cases: [Valid] [Invalid] [Invalid] [Invalid] [Invalid] [Invalid]
ird-46 (Mandatory)
Context: OptionalEarlyTermination (complex type)
[exists(cashSettlement/cashSettlementValuationDate)]
The cashSettlement/cashSettlementValuationDate/dateRelativeTo/@href attribute = the cashSettlement/cashSettlementPaymentDate/@id attribute.
Test cases: [Valid] [Invalid]
ird-47 (Mandatory)
Context: OptionalEarlyTermination (complex type)
[exists(cashSettlement/cashSettlementPaymentDate)]
The cashSettlement/cashSettlementPaymentDate/relativeDate/dateRelativeTo/@href attribute = the americanExercise/@id, bermudaExercise/@id or europeanExercise/@id, whichever one exists.
Test cases: [Valid] [Invalid]
ird-48 (Mandatory)
Context: Swaption (complex type)
[exists(cashSettlement/cashSettlementPaymentDate)]
The cashSettlement/cashSettlementPaymentDate/relativeDate/dateRelativeTo/@href attribute = the @id attribute of americanExercise, bermudaExercise or europeanExercise, whichever one exists.
Test cases: [Valid] [Invalid]
ird-49 (Mandatory)
Context: ResetFrequency (complex type)
iff(exist weeklyRollConvention, period = W).
Comment: weeklyRollConvention should exist if and only if the period is W.
Test cases: [Valid] [Valid] [Invalid] [Invalid]
ird-50 (Mandatory)
Context: InterestRateStream (complex type)
[isParametric]
The dates in calculationPeriodAmount/calculation/notionalSchedule/notionalStepSchedule/step/stepDate must be unadjusted calculation period dates in the schedule implied by calculationPeriodDates.
Comment: The rule states that stepDates must be unadjusted period dates in calculationPeriodDates - but the only explicit dates in calculationPeriodDates are the effective- and termination-Date, together with the "RegularPeriod" dates which may appear optionally in the presence of stubs. These dates, in conjunction with the calculation period frequency, imply a schedule of unadjusted period dates; it is this implied schedule which the values of notionalStepSchedule//stepDate must match.
Test cases: [Valid] [Valid] [Invalid] [Invalid] [Invalid]
ird-51 (Mandatory)
Context: InterestRateStream (complex type)
[isParametric]
The dates in calculationPeriodAmount/calculation/notionalSchedule/fixedRateSchedule/step/stepDate must be unadjusted calculation period dates in the schedule implied by calculationPeriodDates.
Comment: The rule states that stepDates must be unadjusted period dates in calculationPeriodDates - but the only explicit dates in calculationPeriodDates are the effective- and termination-Date, together with the "RegularPeriod" dates which may appear optionally in the presence of stubs. These dates, in conjunction with the calculation period frequency, imply a schedule of unadjusted period dates; it is this implied schedule which the values of fixedRateSchedule//stepDate must match.
Test cases: [Valid] [Valid] [Invalid] [Invalid] [Invalid] [Invalid]
ird-52 (Mandatory)
Context: InterestRateStream (complex type)
[isParametric]
The dates in calculationPeriodAmount/calculation/floatingRateCalculation/capRateSchedule/step/stepDate must be unadjusted calculation period dates in the schedule implied by calculationPeriodDates.
Comment: The rule states that stepDates must be unadjusted period dates in calculationPeriodDates - but the only explicit dates in calculationPeriodDates are the effective- and termination-Date, together with the "RegularPeriod" dates which may appear optionally in the presence of stubs. These dates, in conjunction with the calculation period frequency, imply a schedule of unadjusted period dates; it is this implied schedule which the values of capRateSchedule//stepDate must match.
Test cases: [Valid] [Valid] [Invalid] [Invalid] [Invalid] [Invalid]
ird-53 (Mandatory)
Context: InterestRateStream (complex type)
[isParametric]
The dates in calculationPeriodAmount/calculation/floatingRateCalculation/floorRateSchedule/step/stepDate must be unadjusted calculation period dates in the schedule implied by calculationPeriodDates.
Comment: The rule states that stepDates must be unadjusted period dates in calculationPeriodDates - but the only explicit dates in calculationPeriodDates are the effective- and termination-Date, together with the "RegularPeriod" dates which may appear optionally in the presence of stubs. These dates, in conjunction with the calculation period frequency, imply a schedule of unadjusted period dates; it is this implied schedule which the values of floorRateSchedule//stepDate must match.
Test cases: [Valid] [Valid] [Invalid] [Invalid] [Invalid] [Invalid]
ird-54 (Mandatory)
Context: InterestRateStream (complex type)
[isParametric]
The dates in calculationPeriodAmount/knownAmountSchedule/step/stepDate must be unadjusted calculation period dates in the schedule implied by calculationPeriodDates.
Comment: The rule states that stepDates must be unadjusted period dates in calculationPeriodDates - but the only explicit dates in calculationPeriodDates are the effective- and termination-Date, together with the "RegularPeriod" dates which may appear optionally in the presence of stubs. These dates, in conjunction with the calculation period frequency, imply a schedule of unadjusted period dates; it is this implied schedule which the values of knownAmountSchedule//stepDate must match.
Test cases: [Valid] [Valid] [Invalid] [Invalid] [Invalid] [Invalid]
ird-55 (Mandatory)
Context: InterestRateStream (complex type)
The paymentDates/calculationPeriodDatesReference/@href attribute = the calculationPeriodDates/@id attribute.
Test cases: [Valid] [Invalid]
ird-56 (Mandatory)
Context: InterestRateStream (complex type)
The paymentDates/resetDatesReference/@href attribute = the resetDates/@id attribute.
Test cases: [Valid] [Invalid]
ird-57 (Mandatory)
Context: CalculationPeriodFrequency (complex type)
[isParametric] [rollConvention != ("NONE", "SFE", "MON", "TUE", "WED", "THU", "FRI", "SAT","SUN")]
period must be M or Y.
Test cases: [Valid] [Valid] [Valid] [Valid] [Invalid]
ird-58 (Mandatory)
Context: CalculationPeriodFrequency (complex type)
[isParametric] [rollConvention = ("NONE", "SFE", "MON", "TUE", "WED", "THU", "FRI", "SAT","SUN")]
period =W.
ird-59 (Mandatory)
Context: ResetDates (complex type)
In calculationPeriodDatesReference, the @href attribute = the @id attribute of calculationPeriodDates in the same swapStream.

#### Deprecated rules

ird-26 (Mandatory)
DEPRECATED: Context: BusinessCentersReference; Description: The @href attribute must match the @id attribute of a businessCenters element somewhere within the document. Rationale for deprecation: the rule has been replaced by the reference rule number 39 (ref-39)
ird-28 (Mandatory)
DEPRECATED: Context: MandatoryEarlyTermination; Description: If cashSettlement/cashSettlementValuationDate exists, the cashSettlement/cashSettlementValuationDate/dateRelativeTo/@href attribute = the mandatoryEarlyTerminationDate/@id attribute. Rationale for deprecation: the rule has been replaced by the reference rule number 38 (ref-38)
ird-32 (Mandatory)
DEPRECATED: Context: Discounting; Description: If discountRate is absent then discountRateDayCountFraction must also be absent. Rationale for deprecation: the rule has been replaced by a schema constraint.
ird-38 (Mandatory)
DEPRECATED: Context: StubCalculationPeriodAmount; Description: Either initialStub or finalStub must exist. Rationale for deprecation: the rule has been replaced by a schema constraint.

#### Removed rules