# FpML 4.5 Validation Rules - Rules for Equity Derivatives (EQD)

This is the Equity 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.

Additionally, an XQuery implementation of the validation rules is also provided. See the Reference Implementations section for details.

## Content

- Namespace
- Functions
- Rules
- Rules with comments
  - eqd-23
  - eqd-25
  - eqd-26
  - eqd-27
  - eqd-28
  - eqd-29
  - eqd-30
  - eqd-31
  - eqd-32

## Namespace

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

## Functions

The following shared functions are used in the rules.

- same-currency

## Rules

#### Unique contexts:

- Trade (complex type): eqd-2 eqd-4 eqd-12 eqd-13 eqd-14 eqd-23 eqd-31
- Contract (complex type): eqd-2b eqd-4b eqd-12b eqd-13b eqd-14b eqd-30 eqd-32
- EquityAmericanExercise (complex type): eqd-3
- EquityBermudaExercise (complex type): eqd-6 eqd-7 eqd-8 eqd-9 eqd-10
- EquityExerciseValuationSettlement (complex type): eqd-15
- EquityOption (complex type): eqd-17 eqd-18 eqd-19 eqd-20
- CalculationAgent (complex type): eqd-21
- EquityDerivativeBase (complex type): eqd-22
- AveragingSchedule (complex type): eqd-24
- BrokerEquityOption (complex type): eqd-25
- EquityMultipleExercise (complex type): eqd-26 eqd-27 eqd-28 eqd-29
- Deprecated rules
- Removed rules

eqd-2 (Mandatory)
Context: Trade (complex type)
[exists(equityOption/equityExercise/equityAmericanExercise)]
equityOption/equityExercise/equityAmericanExercise/expirationDate/adjustableDate/unadjustedDate >= tradeHeader/tradeDate.
Test cases: [Valid] [Invalid]
eqd-2b (Mandatory)
Context: Contract (complex type)
[exists(equityOption/equityExercise/equityAmericanExercise)]
equityOption/equityExercise/equityAmericanExercise/expirationDate/adjustableDate/unadjustedDate >= header/contractDate.
Test cases: [Valid] [Invalid]
eqd-3 (Mandatory)
Context: EquityAmericanExercise (complex type)
[latestExerciseTimeType = SpecificTime]
latestExerciseTime exists.
Test cases: [Valid] [Invalid]
eqd-4 (Mandatory)
Context: Trade (complex type)
[exists(equityOption/equityExercise/equityBermudaExercise)]
equityOption/equityExercise/equityBermudaExercise/commencementDate/adjustableDate/unadjustedDate >= tradeHeader/tradeDate.
Test cases: [Valid] [Invalid]
eqd-4b (Mandatory)
Context: Contract (complex type)
[exists(equityOption/equityExercise/equityBermudaExercise)]
equityOption/equityExercise/equityBermudaExercise/commencementDate/adjustableDate/unadjustedDate >= header/contractDate.
Test cases: [Valid] [Invalid]
eqd-6 (Mandatory)
Context: EquityBermudaExercise (complex type)
[latestExerciseTimeType = SpecificTime]
latestExerciseTime exists.
Test cases: [Valid] [Invalid]
eqd-8 (Mandatory)
Context: EquityBermudaExercise (complex type)
All dates in bermudaExerciseDates/date > commencementDate/adjustableDate/unadjustedDate.
Test cases: [Valid] [Invalid] [Invalid]
eqd-9 (Mandatory)
Context: EquityBermudaExercise (complex type)
All dates in bermudaExerciseDates/date <= expirationDate/adjustableDate/unadjustedDate.
Test cases: [Valid] [Invalid]
eqd-10 (Mandatory)
Context: EquityBermudaExercise (complex type)
The dates in bermudaExerciseDates/date must be unique.
Test cases: [Valid] [Invalid]
eqd-12 (Mandatory)
Context: Trade (complex type)
[exists(equityOption/equityExercise/equityEuropeanExercise)]
equityOption/equityExercise/equityEuropeanExercise/expirationDate/adjustableDate/unadjustedDate >= tradeHeader/tradeDate.
Test cases: [Valid] [Invalid]
eqd-12b (Mandatory)
Context: Contract (complex type)
[exists(equityOption/equityExercise/equityEuropeanExercise)]
equityOption/equityExercise/equityEuropeanExercise/expirationDate/adjustableDate/unadjustedDate >= header/contractDate.
Test cases: [Valid] [Invalid]
eqd-13 (Mandatory)
Context: Trade (complex type)
[exists(equityOption/equityPremium/paymentDate/unadjustedDate)]
equityOption/equityPremium/paymentDate/unadjustedDate >= tradeHeader/tradeDate.
Test cases: [Valid] [Invalid]
eqd-13b (Mandatory)
Context: Contract (complex type)
[exists(equityOption/equityPremium/paymentDate/unadjustedDate)]
equityOption/equityPremium/paymentDate/unadjustedDate >= header/contractDate.
Test cases: [Valid] [Invalid]
eqd-14 (Mandatory)
Context: Trade (complex type)
[exists(brokerEquityOption/equityPremium/paymentDate/unadjustedDate)]
brokerEquityOption/equityPremium/paymentDate/unadjustedDate >= tradeHeader/tradeDate.
Test cases: [Valid] [Invalid]
eqd-14b (Mandatory)
Context: Contract (complex type)
[exists(brokerEquityOption/equityPremium/paymentDate/unadjustedDate)]
brokerEquityOption/equityPremium/paymentDate/unadjustedDate >= header/contractDate.
Test cases: [Valid] [Invalid]
eqd-15 (Mandatory)
Context: EquityExerciseValuationSettlement (complex type)
[exists(equityValuation/valuationDate/adjustableDate)] [exists(equityEuropeanExercise)]
equityValuation/valuationDate/adjustableDate/unadjustedDate = equityEuropeanExercise/expirationDate/adjustableDate/unadjustedDate.
Test cases: [Valid] [Invalid]
eqd-17 (Mandatory)
Context: EquityOption (complex type)
EquityDerivativeShortFormBase (complex type)
equityExercise/equityAmericanExercise/equityMultipleExercise/maximumNumberOfOptions * equityExercise/equityAmericanExercise/equityMultipleExercise/integralMultipleExercise >= numberOfOptions.
Test cases: [Valid] [Valid] [Invalid] [Invalid]
eqd-18 (Mandatory)
Context: EquityOption (complex type)
EquityDerivativeShortFormBase (complex type)
[exists(equityExercise/equityBermudaExercise/equityMultipleExercise)] [exists(numberOfOptions)]
maximumNumberOfOptions * integralMultipleExercise (in equityExercise/equityBermudaExercise/equityMultipleExercise) <= numberOfOptions.
Test cases: [Valid] [Valid] [Invalid] [Invalid]
eqd-19 (Mandatory)
Context: EquityOption (complex type)
EquityDerivativeShortFormBase (complex type)
[exists(notional)] [exists(equityPremium/percentageOfNotional)] [exists(equityPremium/paymentAmount)] [same-currency((equityPremium/paymentAmount,notional))]
equityPremium/paymentAmount/amount = notional/amount * equityPremium/percentageOfNotional.
Test cases: [Valid] [Invalid]
eqd-20 (Mandatory)
Context: EquityOption (complex type)
EquityOptionTransactionSupplement (complex type)
[exists(numberOfOptions)] [exists(optionEntitlement)] [exists(equityPremium/paymentAmount)] [exists(equityPremium/pricePerOption)] [same-currency((equityPremium/paymentAmount,equityPremium/pricePerOption))]
equityPremium/pricePerOption/amount * $equityOption/numberOfOptions * $equityOption/optionEntitlement = $equityOption/equityPremium/paymentAmount/amount.
Test cases: [Valid] [Valid] [Invalid] [Invalid]
eqd-22 (Mandatory)
Context: EquityDerivativeBase (complex type)
buyerPartyReference/@href != sellerPartyReference/@href.
Test cases: [Valid] [Invalid]
eqd-23 (Mandatory)
Context: Trade (complex type)
[exists(equityOption/equityEffectiveDate)]
equityOption/equityEffectiveDate >= tradeHeader/tradeDate.
Comment: The equityEffectiveDate exists only in the case of a forward starting option.
Test cases: [Valid] [Invalid]
eqd-24 (Mandatory)
Context: AveragingSchedule (complex type)
startDate <= endDate.
Test cases: [Valid] [Invalid]
eqd-25 (Mandatory)
Context: BrokerEquityOption (complex type)
[exists(numberOfOptions)] [exists(equityPremium/paymentAmount)] [exists(equityPremium/pricePerOption)] [same-currency((equityPremium/paymentAmount,equityPremium/pricePerOption))]
equityPremium/pricePerOption/amount * numberOfOptions = equityPremium/paymentAmount/amount.
Comment: This is equivalent to eqd-20, but for brokerEquityOption, where there is no optionEntitlement.
Test cases: [Valid] [Invalid]
eqd-26 (Mandatory)
Context: EquityMultipleExercise (complex type)
maximumNumberOfOptions <= numberOfOptions.
Comment: You cannot exercise more than the number of options you have.
Test cases: [Valid] [Invalid]
eqd-27 (Mandatory)
Context: EquityMultipleExercise (complex type)
minimumNumberOfOptions <= maximumNumberOfOptions.
Comment: Maximum number of options to exercise must be greater than or equal to minimum number of options to exercise.
Test cases: [Valid] [Invalid]
eqd-28 (Mandatory)
Context: EquityMultipleExercise (complex type)
[exists(integralMultipleExercise)]
minimumNumberOfOptions must be a positive integer multiple of integralMultipleExercise.
Comment: When integral multiple exercise is present, minimum number of options exercised must be a positive integer multiple of integral multiple exercise.
Test cases: [Valid] [Invalid]
eqd-29 (Mandatory)
Context: EquityMultipleExercise (complex type)
[exists(integralMultipleExercise)]
maximumNumberOfOptions must be a positive integer multiple of integralMultipleExercise.
Comment: When integral multiple exercise exists, maximum number of options exercised must be a positive integer multiple of integral multiple exercise.
Test cases: [Valid] [Invalid]
eqd-30 (Mandatory)
Context: Contract (complex type)
[exists(equityOption/equityEffectiveDate)]
equityOption/equityEffectiveDate >= header/contractDate.
Comment: The equityEffectiveDate exists only in the case of a forward starting option.
Test cases: [Valid] [Invalid]
eqd-31 (Mandatory)
Context: Trade (complex type)
[//element(*, EquityDerivativeBase)/equityEffectiveDate]
Every $equityDerivativeBase in //element(*, EquityDerivativeBase)[exists(equityEffectiveDate)] $equityDerivativeBase >= tradeHeader/tradeDate.
Comment: The starting date of an equity option must be after the trade date.
Test cases: [Valid] [Invalid]
eqd-32 (Mandatory)
Context: Contract (complex type)
[//element(*, EquityDerivativeBase)/equityEffectiveDate]
Every $equityDerivativeBase in //element(*, EquityDerivativeBase)[exists(equityEffectiveDate)] $equityDerivativeBase >= header/contractDate.
Comment: The starting date of an equity option must be after the contract date.
Test cases: [Valid] [Invalid]

#### Deprecated rules

eqd-7 (Mandatory)
DEPRECATED: Context: equityBermudaExercise; Description: The elements in bermudaExerciseDates/date should be in order, earliest date first. Rationale for deprecation: Enforcing that data should be in specific order is not permitted.
Test cases: [Valid] [Invalid]
eqd-21 (Mandatory)
DEPRECATED: Context: CalculationAgent; Description: calculationAgentPartyReference must exist. Rationale for deprecation: EQDWG 2007-11-30; agreed that this rule doesn't make any business sense since the calculation agent may be specified in the master confirmation or the master agreement.
Test cases: [Valid] [Invalid]

#### Removed rules

eqd-1 (Mandatory)
REMOVED: Context: Trade, Contract; Description: //equityExercise/equityAmericanExercise/commencementDate/adjustableDate/unadjustedDate must be equal to tradeHeader/tradeDate. Rationale for removal: incorrect from business perspective.
eqd-5 (Mandatory)
REMOVED: Context: Trade, Contract; Description: //equityExercise/equityBermudaExercise/expirationDate/adjustableDate/unadjustedDate must be greater than or equal to tradeHeader/tradeDate. Rationale for removal: eqd-5 is redundant. The effect of eqd-5 is available by entailment on eqd-4, eqd-8, eqd-9.
eqd-11 (Mandatory)
REMOVED: Context: EquityBermudanExercise; Description: latestExerciseTime/hourMinuteTime must be before or equal to equityExpirationTime/hourMinuteTime.
eqd-16 (Mandatory)
REMOVED: Context: EquityMultipleExercise; Description: minimumNumberOfOptions < maximumNumberOfOptions. Rationale for removal: inconsistent with rule eqd-27