FpML 4.9 Validation Rules - Rules for FX Derivatives
This is the FX part of the validation rule set accompanying the FpML 4.9 Last Call Working Draft. The introductory section
in the validation section of the specifications 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. The cut down test cases
are non-normative and are provided for the purpose of documentation only.
Content
Namespace
default element namespace = http://www.fpml.org/2010/FpML-4-9
namespace xs = http://www.w3.org/2001/XMLSchema
Definitions
Term: calculated schedule dates Correctly evaluating rule fx-12 requires generation of a schedule of observation dates based on the observation start date,
the observation end date, a calculation period frequency, a date roll convention, and a business day calendar for business
center where fixing occurs. The calculation should proceed as follows:
- generatedDates := [null];
- unadjustedDate := observationStartDate;
- while unadjustedDate le observationEndDate do
- begin
- adjustedDate := dateRoll (unadjustedDate,dateRollConvention,businessDayCalendar);
- if adjustedDate [doesn't belong at] generatedDates then
- generatedDates := generatedDate [union] adjustedDate;
- unadjustedDate := unadjustedDate + calculationPeriodFrequency;
- end;
- return (generatedDates);
The algorithm assumes that implementations can add a time period (e.g. 1D, 1W, 2M, 6M, 1Y, etc.) to dates and understands
how perform standard financial date rolls (e.g. following, modified preceding, etc.) against a business day calendar. Implementations
must be capable of working with dates that MAY contain time zone offset information.
Functions
The following shared functions are used in the rules.
Rules
fx-1 (Mandatory)
English Description:
Context: ExchangeRate (complex type)
rate must be positive
XPath Description:
Context: ExchangeRate
rate gt 0
fx-2 (Mandatory)
English Description:
Context: ExchangeRate (complex type)
If forwardPoints exists, then spotRate must exist
XPath Description:
Context: ExchangeRate
[exists(forwardPoints)]
exists(spotRate)
fx-3 (Mandatory)
English Description:
Context: ExchangeRate (complex type)
If spotRate exists, and if forwardPoints exists, then rate is equal to the sum of spotRate and forwardPoints
XPath Description:
Context: ExchangeRate
[exists(spotRate)] [exists(forwardPoints)]
rate eq spotRate + forwardPoints
fx-4 (Mandatory)
English Description:
Context: ExchangeRate (complex type)
If
sideRates/baseCurrency,
quotedCurrencyPair/currency1 and
quotedCurrencyPair/currency2 have the same
same-currency-scheme, then
sideRates/baseCurrency is not equal to the values of both
quotedCurrencyPair/currency1 and
quotedCurrencyPair/currency2
XPath Description:
Context: ExchangeRate
[
same-currency-scheme((
sideRates/baseCurrency,
quotedCurrencyPair/currency1,
quotedCurrencyPair/currency2))]
sideRates/baseCurrency ne the values of both quotedCurrencyPair/currency1 and quotedCurrencyPair/currency2
fx-5 (Mandatory)
English Description:
Context: ExchangeRate (complex type)
If
sideRates/currency1SideRate/currency and
quotedCurrencyPair/currency1 have the
same-currency-scheme, then
sideRates/currency1SideRate/currency must be equal to
quotedCurrencyPair/currency1
XPath Description:
Context: ExchangeRate
sideRates/currency1SideRate/currency eq quotedCurrencyPair/currency1
fx-6 (Mandatory)
English Description:
Context: ExchangeRate (complex type)
If
sideRates/currency2SideRate/currency and
quotedCurrencyPair/currency2 have the
same-currency-scheme, then
sideRates/currency2SideRate/currency must be equal to
quotedCurrencyPair/currency2
XPath Description:
Context: ExchangeRate
sideRates/currency2SideRate/currency eq quotedCurrencyPair/currency2
fx-7 (Mandatory)
English Description:
Context: FxAmericanTrigger (complex type)
triggerRate must be positive
XPath Description:
Context: FxAmericanTrigger
triggerRate gt 0
fx-8 (Mandatory)
English Description:
Context: FxAmericanTrigger (complex type)
If observationStartDate exists, and if observationEndDate exists, then observationStartDate must be before observationEndDate
XPath Description:
Context: FxAmericanTrigger
[exists(observationStartDate)] [exists(observationEndDate)]
observationStartDate le observationEndDate
fx-9 (Mandatory)
English Description:
Context: FxAverageRateObservationSchedule (complex type)
If observationStartDate exists, and if observationEndDate exists, then observationStartDate must be before observationEndDate
XPath Description:
Context: FxAverageRateObservationSchedule
[exists(observationStartDate)] [exists(observationEndDate)]
observationStartDate le observationEndDate
fx-10 (Mandatory)
English Description:
Context: FxAverageRateObservationSchedule (complex type)
The observation period defined by observationStartDate and observationEndDate should be an integer multiple of the calculationPeriodFrequency
fx-11 (Mandatory)
English Description:
Context: FxAverageRateOption (complex type)
The value of each observedRates/observationDate must be unique
XPath Description:
Context: FxAverageRateOption
count(distinct-values(observedRates/observationDate)) eq count(observedRates/observationDate)
fx-12 (Mandatory)
English Description:
Context: FxAverageRateOption (complex type)
If
averageRateObservationSchedule exists, then the values of
observedRates/observationDate equals the
calculated schedule dates derived from parameters defined within the
averageRateObservationSchedule element and the business day calendar implied by
fixingTime/businessCenter
fx-13 (Mandatory)
English Description:
Context: FxAverageRateOption (complex type)
If averageRateObservationDate exists, then each observedRates/observationDate must equal one of the dates defined by averageRateObservationDate/observationDate
fx-14 (Mandatory)
English Description:
Context: FxBarrier (complex type)
If observationStartDate exists, and if observationEndDate exists, then observationStartDate must be before observationEndDate
XPath Description:
Context: FxBarrier
[exists(observationStartDate)] [exists(observationEndDate)]
observationStartDate le observationEndDate
fx-15 (Mandatory)
English Description:
Context: FxBarrierOption (complex type)
If spotRate exists, then spotRate must be positive
XPath Description:
Context: FxBarrierOption
[exists(spotRate)]
spotRate gt 0
fx-16 (Mandatory)
English Description:
Context: FxDigitalOption (complex type)
If spotRate exists, then spotRate must be positive
XPath Description:
Context: FxDigitalOption
[exists(spotRate)]
spotRate gt 0
fx-17 (Mandatory)
English Description:
Context: FxEuropeanTrigger (complex type)
triggerRate must be positive
XPath Description:
Context: FxEuropeanTrigger
triggerRate gt 0
fx-18 (Mandatory)
English Description:
Context: FxLeg (complex type)
exchangedCurrency1/payerPartyReference/@href must be equal to exchangedCurrency2/receiverPartyReference/@href and exchangedCurrency1/receiverPartyReference/@href must be equal to exchangedCurrency2/payerPartyReference/@href
XPath Description:
Context: FxLeg
(exchangedCurrency1/payerPartyReference/@href eq exchangedCurrency2/receiverPartyReference/@href) and (exchangedCurrency1/receiverPartyReference/@href eq exchangedCurrency2/payerPartyReference/@href)
fx-19 (Mandatory)
English Description:
Context: FxLeg (complex type)
If
exchangedCurrency1/paymentAmount and
exchangedCurrency2/paymentAmount have the
same-currency-scheme, then
exchangedCurrency1/paymentAmount/currency must not be equal to
exchangedCurrency2/paymentAmount/currency
XPath Description:
Context: FxLeg
exchangedCurrency1/paymentAmount/currency ne exchangedCurrency2/paymentAmount/currency
fx-20 (Mandatory)
English Description:
Context: FxLeg (complex type)
If currency1ValueDate exists, then currency1ValueDate must not be equal to currency2ValueDate
XPath Description:
Context: FxLeg
[exists(currency1ValueDate)]
currency1ValueDate ne currency2ValueDate
fx-21 (Mandatory)
English Description:
Context: FxLeg (complex type)
If nonDeliverableForward exists, then exchangeRate/forwardPoints must exist
XPath Description:
Context: FxLeg
[exists(nonDeliverableForward)]
exists(exchangeRate/forwardPoints)
fx-22 (Mandatory)
English Description:
Context: FxOptionLeg (complex type)
If fxOptionPremium exists, then buyerPartyReference/@href must be equal to fxOptionPremium/payerPartyReference/@href and sellerPartyReference/@href must be equal to fxOptionPremium/receiverPartyReference/@href
XPath Description:
Context: FxOptionLeg
[exists(fxOptionPremium)]
(buyerPartyReference/@href eq fxOptionPremium/payerPartyReference/@href) and (sellerPartyReference/@href eq fxOptionPremium/receiverPartyReference/@href)
fx-23 (Mandatory)
English Description:
Context: FxOptionLeg (complex type)
If
putCurrencyAmount and
callCurrencyAmount have the
same-currency-scheme, then
putCurrencyAmount/currency must not be equal to
callCurrencyAmount/currency
XPath Description:
Context: FxOptionLeg
putCurrencyAmount/currency ne callCurrencyAmount/currency
fx-24 (Mandatory)
English Description:
Context: FxStrikePrice (complex type)
rate must be positive
XPath Description:
Context: FxStrikePrice
rate gt 0
fx-25 (Mandatory)
English Description:
Context: FxSwap (complex type)
Two or more fxSingleLeg elements must exist
XPath Description:
Context: FxSwap
count(fxSingleLeg) ge 2
fx-26 (Mandatory)
English Description:
Context: FxSwap (complex type)
If there are two fxSingleLeg, and if there are two fxSingleLeg\valueDate, then the fxSingleLeg\valueDate for each one of the legs must be different
XPath Description:
Context: FxSwap
[count(fxSingleLeg)=2] [count(fxSingleLeg\valueDate)=2]
fxSingleLeg[1]/valueDate ne fxSingleLeg[2]/valueDate
fx-27 (Mandatory)
English Description:
Context: QuotedCurrencyPair (complex type)
If
currency1 and
currency2 have the
same-currency-scheme, then
currency1 must not be equal to
currency2
XPath Description:
Context: QuotedCurrencyPair
currency1 ne currency2
fx-28 (Mandatory)
English Description:
Context: SideRate (complex type)
rate must be positive
XPath Description:
Context: SideRate
rate gt 0
fx-29 (Mandatory)
English Description:
Context: SideRate (complex type)
If forwardPoints exists, then spotRate must exist
XPath Description:
Context: SideRate
[exists(forwardPoints)]
exists(spotRate)
fx-30 (Mandatory)
English Description:
Context: SideRate (complex type)
If spotRate exists, and if forwardPoints exists, then rate must be equal to the sum of spotRate and forwardPoints
XPath Description:
Context: SideRate
[exists(spotRate)] [exists(forwardPoints)]
rate eq spotRate + forwardPoints
fx-31 (Mandatory)
English Description:
Context: SideRates (complex type)
If
baseCurrency,
currency1SideRate/currency,
currency2SideRate/currency have the
same-currency-scheme, then
baseCurrency must not be equal to
currency1SideRate/currency, and
baseCurrency must not be equal to
currency2SideRate/currency
XPath Description:
Context: SideRates
(baseCurrency ne currency1SideRate/currency) and (baseCurrency ne currency2SideRate/currency)
fx-32 (Mandatory)
English Description:
Context: TermDeposit (complex type)
The @href attribute of initialPayerReference must not be equal to the @href attribute of initialReceiverReference
XPath Description:
Context: TermDeposit
initialPayerReference/@href ne initialReceiverReference/@href
fx-33 (Mandatory)
English Description:
Context: TermDeposit (complex type)
maturityDate must be after startDate
XPath Description:
Context: TermDeposit
maturityDate gt startDate
fx-34 (Mandatory)
English Description:
Context: TermDeposit (complex type)
principal/amount must be positive
XPath Description:
Context: TermDeposit
principal/amount gt 0
fx-35 (Mandatory)
English Description:
Context: TermDeposit (complex type)
fixedRate must be positive
XPath Description:
Context: TermDeposit
fixedRate gt 0
fx-36 (Mandatory)
English Description:
Context: Trade (complex type)
If fxAverageRateOption exists, then fxAverageRateOption/expiryDateTime/expiryDate must be after tradeHeader/tradeDate
XPath Description:
Context: Trade
[exists(fxAverageRateOption)]
fxAverageRateOption/expiryDateTime/expiryDate gt tradeHeader/tradeDate
fx-36b (Mandatory)
English Description:
Context: Contract (complex type)
If fxAverageRateOption exists, then fxAverageRateOption/expiryDateTime/expiryDate must be after header/contractDate
XPath Description:
Context: Contract
[exists(fxAverageRateOption)]
fxAverageRateOption/expiryDateTime/expiryDate gt header/contractDate
fx-37 (Mandatory)
XPath Description:
Context: Trade
[exists(fxBarrierOption)]
If fxBarrierOption exists, then fxBarrierOption/expiryDateTime/expiryDate must be after tradeHeader/tradeDatefxBarrierOption/expiryDateTime/expiryDate gt tradeHeader/tradeDate
fx-37b (Mandatory)
English Description:
Context: Contract (complex type)
If fxBarrierOption exists, then fxBarrierOption/expiryDateTime/expiryDate must be after header/contractDate
XPath Description:
Context: Contract
[exists(fxBarrierOption)]
fxBarrierOption/expiryDateTime/expiryDate gt header/contractDate
fx-38 (Mandatory)
English Description:
Context: Trade (complex type)
If fxDigitalOption exists, then fxDigitalOption/expiryDateTime/expiryDate must be after tradeHeader/tradeDate
XPath Description:
Context: Trade
[exists(fxDigitalOption)]
fxDigitalOption/expiryDateTime/expiryDate gt tradeHeader/tradeDate
fx-38b (Mandatory)
English Description:
Context: Contract (complex type)
If fxDigitalOption exists, then fxDigitalOption/expiryDateTime/expiryDate must be after header/contractDate
XPath Description:
Context: Contract
[exists(fxDigitalOption)]
fxDigitalOption/expiryDateTime/expiryDate gt header/contractDate
fx-39 (Mandatory)
English Description:
Context: Trade (complex type)
If fxSingleLeg exists, then the value of fxSingleLeg/valueDate or the value of both fxSingleLeg/currency1ValueDate and fxSingleLeg/currency2ValueDate must be after tradeHeader/tradeDate
XPath Description:
Context: Trade
[exists(fxSingleLeg)]
(fxSingleLeg/valueDate gt tradeHeader/tradeDate) or ((fxSingleLeg/currency1ValueDate, fxSingleLeg/currency2ValueDate) gt tradeHeader/tradeDate)
fx-39b (Mandatory)
English Description:
Context: Contract (complex type)
If fxSingleLeg exists, then the value of fxSingleLeg/valueDate or the value of both fxSingleLeg/currency1ValueDate and fxSingleLeg/currency2ValueDate must be after header/contractDate
XPath Description:
Context: Contract
[exists(fxSingleLeg)]
fxSingleLeg/valueDate gt header/contractDate) or ((fxSingleLeg/currency1ValueDate, fxSingleLeg/currency2ValueDate) gt header/contractDate)
fx-40 (Mandatory)
English Description:
Context: Trade (complex type)
The value of all fxSwap/fxSingleLeg/valueDate, fxswap/fxSingleLeg/currency1ValueDate and fxSwap/fxSingleLeg/currency2ValueDate instances must be after tradeHeader/tradeDate
XPath Description:
Context: Trade
for all $vd in fxSwap/fxSingleLeg/(valueDate|currency1ValueDate|currency2ValueDate) satisfies $vd gt tradeHeader/tradeDate
fx-40b (Mandatory)
English Description:
Context: Contract (complex type)
The value of all fxSwap/fxSingleLeg/valueDate, fxswap/fxSingleLeg/currency1ValueDate and fxSwap/fxSingleLeg/currency2ValueDate instances must be after header/contractDate
XPath Description:
Context: Contract
for all $vd in fxSwap/fxSingleLeg/(valueDate|currency1ValueDate|currency2ValueDate) satisfies $vd gt header/contractDate
fx-41 (Mandatory)
English Description:
Context: FxBarrier (complex type)
triggerRate must be positive
XPath Description:
Context: FxBarrier
triggerRate gt 0
fx-42 (Mandatory)
English Description:
Context: FxAverageRateOption (complex type)
The value of each averageRateObservationDate/observationDate must be unique
XPath Description:
Context: FxAverageRateOption
count(distinct-values(averageRateObservationDate/observationDate)) eq count(averageRateObservationDate/observationDate)
fx-43 (Mandatory)
English Description:
Context: FxAverageRateOption (complex type)
If
putCurrencyAmount and
callCurrencyAmount have the
same-currency-scheme, then
putCurrencyAmount/currency must not be equal to
callCurrencyAmount/currency
XPath Description:
Context: FxAverageRateOption
putCurrencyAmount/currency ne callCurrencyAmount/currency
fx-44 (Mandatory)
English Description:
Context: FxAverageRateOption (complex type)
If fxOptionPremium exists, then buyerPartyReference/@href must be equal to fxOptionPremium/payerPartyReference/@href and sellerPartyReference/@href must be equal to fxOptionPremium/receiverPartyReference/@href
XPath Description:
Context: FxAverageRateOption
[exists(fxOptionPremium)]
(buyerPartyReference/@href eq fxOptionPremium/payerPartyReference/@href) and (sellerPartyReference/@href eq fxOptionPremium/receiverPartyReference/@href)
fx-45 (Mandatory)
English Description:
Context: FxDigitalOption (complex type)
If fxOptionPremium exists, then buyerPartyReference/@href must be equal to fxOptionPremium/payerPartyReference/@href, and sellerPartyReference/@href must be equal to fxOptionPremium/receiverPartyReference/@href
XPath Description:
Context: FxDigitalOption
[exists(fxOptionPremium)]
buyerPartyReference/@href eq fxOptionPremium/payerPartyReference/@href and sellerPartyReference/@href eq fxOptionPremium/receiverPartyReference/@href
fx-46 (Mandatory)
English Description:
Context: SideRates (complex type)
currency1SideRate/sideRateBasis is equal to either "BaseCurrencyPerCurrency1" or "Currency1PerBaseCurrency".
XPath Description:
Context: SideRates
currency1SideRate/sideRateBasis = ("BaseCurrencyPerCurrency1" , "Currency1PerBaseCurrency")
fx-47 (Mandatory)
English Description:
Context: SideRates (complex type)
currency2SideRate/sideRateBasis is equal to either "BaseCurrencyPerCurrency2" or "Currency2PerBaseCurrency".
XPath Description:
Context: SideRates
currency2SideRate/sideRateBasis = ("BaseCurrencyPerCurrency2" , "Currency2PerBaseCurrency")
Deprecated rules
Removed rules