A recipe has a pricing
section that you must populate if you wish to change the default pricing model LUSID provides for each instrument type:
Instrument type | Default pricing model | Effect of model |
---|---|---|
|
| For a bond, sums the remaining coupons and the principal. For an FxForward, sums the two legs with the foreign converted to domestic at the spot rate. |
All other types |
| Multiplies the number of units held by the market price on the valuation date. |
You can change the default for any instrument type except Equity
to provide a more suitable or sophisticated result. You can even conditionally select different pricing models for the same instrument type.
Note: The combination of instrument type and pricing model impacts the quantity and quality of market data required. Find out more about this.
For each instrument type whose pricing model you wish to change, specify a vendor model rule in the modelRules
array of the pricing
section of your recipe. Consider the following example, of three vendor model rules to change the default models for bonds, FxForwards and equity options (all others are left unchanged):
For information on all the fields and allowed values in a vendor model rule, examine the API reference (expand the configurationRecipe/pricing/modelRules
section). The following table summarises core fields:
Vendor model rule field | Status | Explanation |
---|---|---|
| Mandatory | Defaults to |
| Mandatory | If |
| Mandatory | If |
| Optional | Specify if you want to conditionally selects different pricing models for the same instrument type. |
| Optional | Configure pricing models for certain instrument types. If
For all other instrument types, omit this field to use the default value of
For more information on the option fields available, examine the API reference (expand the |
Selecting different pricing models for the same instrument type
You can conditionally select pricing models based on custom properties added to instruments, on instrument features, or both.
For example, you might want to specify that:
American FX option contracts are valued using the
BjerksundStensland1993
pricing model.European FX option contracts sourced from Bloomberg are valued using the
BlackScholes
pricing model.European FX option contracts sourced from UBS are valued using the
Discounting
pricing model.
To do this, specify multiple vendor model rules for the same instrument type and distinguish them using the addressKeyFilters
field:
The
left
field must reference the 3 stage key of either a property or a feature. In the example below,Instrument/FX/DataProvider
is a property added to instruments of typeFxOption
to record the original data provider, whileInstrument/Features/ExerciseType
is a feature key referencing one of the available exercise types for FX option contracts in LUSID.The
operator
field must either beeq
orneq
.The
right
field must be a stringvalue
on which to match, with aresultValueType
ofResultValueString
. Note this means only properties with an underlying data type ofString
are currently supported.
Note: Vendor model rules are processed in the order they are specified in a recipe. The first matching rule found is used. Instruments that do not match any rules fall back to using the default pricing model for the instrument type, which is
SimpleStatic
for FX option contracts.
"pricing": {
"modelRules": [{
"supplier": "Lusid",
"instrumentType": "FxOption",
"addressKeyFilters": [{
"left": "Instrument/Features/ExerciseType",
"operator": "eq",
"right": {
"value": "American",
"resultValueType": "ResultValueString"
}
}],
"modelName": "BjerksundStensland1993"
},
{
"supplier": "Lusid",
"instrumentType": "FxOption",
"addressKeyFilters": [{
"left": "Instrument/Features/ExerciseType",
"operator": "eq",
"right": {
"value": "European",
"resultValueType": "ResultValueString"
}
},
{
"left": "Instrument/FX/DataProvider",
"operator": "eq",
"right": {
"value": "Bloomberg",
"resultValueType": "ResultValueString"
}
}],
"modelName": "BlackScholes"
},
{
"supplier": "Lusid",
"instrumentType": "FxOption",
"addressKeyFilters": [{
"left": "Instrument/Features/ExerciseType",
"operator": "eq",
"right": {
"value": "European",
"resultValueType": "ResultValueString"
}
},
{
"left": "Instrument/FX/DataProvider",
"operator": "eq",
"right": {
"value": "UBS",
"resultValueType": "ResultValueString"
}
}],
"modelName": "Discounting"
}],
...
For a more detailed demonstration of conditional pricing model selection, examine this Jupyter Notebook.