Troubleshooting valuation

Note: You may be able to prevent common errors and problems in the first place by following all the steps in our valuation checklist.

Resolving API errors

If LUSID encounters an API error then a valuation report is not generated.

Market data errors (API error code 321)

You may encounter a market data error consisting of one or more failures, for example:

Each failure means LUSID cannot locate an item of market data required for a particular instrument on a particular date. In the example above, LUSID cannot locate a market price effective 10 March 2025 at midnight for a holding in an instrument with a unique identifier of LUID_00003ECR:

  • Have you loaded a market price for this instrument into the LUSID Quote Store? You can check by using the Data Management > Quotes dashboard or by calling the ListQuotesForScope API to search a quote scope for an item with that instrument identifier on or before that date.

  • If you have loaded a suitable market data item, is there a market data rule in the recipe able to locate it? Note that field values in a market data rule must match equivalent field values in market data items according to the rules in this table.

  • If market data rules are set up correctly, try setting the allowPartiallySuccessfulEvaluation=True pricing model option in the recipe. This relaxes validation rules, though of course missing market data will not be used in calculations.

  • If the missing market data item is an FX rate, try setting the attemptToInferMissingFx=True market data option in the recipe. This enables LUSID to infer FX rates from inverses or triangulate through base currency pairs that are located.

Matured instrument errors (API error code 315)

You may encounter a model specification error if you attempt to value a holding in a term instrument that has matured, for example:

You can choose to reduce the number of units in this holding down to zero, which means it will drop out of valuation reports.

Otherwise, try setting the returnZeroPv{"instrumentMatured": true} pricing model option in the recipe to value a matured instrument with a PV and exposure of zero instead of returning this error.

Choosing different metrics and operations

If the valuation report is not showing the information you expect, you can add or remove metrics. You may also be able to change the operations performed on those metrics.

For example, if you cannot see LUSID’s calculation of PV then add the Valuation/PV metric to the report. You can ask LUSID to show the calculated raw value, or perform an operation such as sum or proportion where it makes sense to do so. Guide to metrics and meaningful operations.

To do this in the LUSID web app:

  1. Click the Configuration cog (in yellow)

  2. Click the Add column button (in green)

  3. Select the metric (“queryable key”) and choose an operation (in red):

If you are calling the GetValuation API then include the metric and a suitable operation in the request, for example:

{
  "portfolioEntityIds": [ {"scope": "Equities", "code": "Growth" ],
  "valuationSchedule": {"effectiveAt": "2025-03-11T00:00:00.0000000+00:00" },
  "recipeId": {"scope": "Recipes", "code": "Equities"},
  "metrics": [
    {"key": "Instrument/default/Name", "op": "Value"},
    {"key": "Valuation/PV", "op": "Value"},
  ]
}

Checking for aggregation errors

An aggregation error occurs if you ask LUSID to perform an operation on a metric that is not meaningful in the context of the report’s current data. For example, if you ask LUSID to sum the Valuation/PV metric but the portfolio contains holdings in different currencies, then LUSID reports an error stating that (for example) GBP cannot be added to USD:

metadata mismatch Dim:0,Units:(GBP) != Dim:0,Units:(USD)

By default, the LUSID web app shows these aggregation errors in a dedicated Errors column. If it is hidden, you can click the Configuration cog (in yellow) and then the eye (in green) to show it:

In the API, you can specify the Aggregation/Errors metric in your call to the GetValuation API:

{
  "portfolioEntityIds": [ {"scope": "Equities", "code": "Growth" ],
  "valuationSchedule": {"effectiveAt": "2025-03-11T00:00:00.0000000+00:00" },
  "recipeId": {"scope": "Recipes", "code": "Equities"},
  "metrics": [
    {"key": "Instrument/default/Name", "op": "Value"},
    {"key": "Valuation/PV", "op": "Value"},
    {"key": "Aggregation/Errors", "op": "Value"},
  ]
} 

Checking constituent data

It may be that there are no API or aggregation errors but LUSID’s calculations for metrics such as PV, P&L, exposure and so on do not ‘look’ correct.

Is LUSID using the right market data?

LUSID may have located market data but it may not be the expected market data. For example, LUSID might value an equity using a bid price when you are expecting a mid price. Or it may use a quote from Refinitiv when you are expecting one from Bloomberg.

You can use the pricing manifest to examine the provenance of the market data LUSID has used in a valuation.

To do this in the LUSID web app, click the Pricing manifest tab (in yellow). In this example, LUSID has used three items of market data: a market price for an equity and two USD/GBP spot rates. You can hover over the JSON Market Data Object column to get a formatted view of each item; here we can see that the equity market price is a mid price sourced from Refinitiv DataScope’s RRPS platform (in green):

Are market prices scaled correctly?

By default, when you load a market price for an instrument into the LUSID Quote Store a scale factor of 1 is applied.

For certain instruments such as bonds, you may need to scale the price by a number representing par in order for LUSID to calculate PV and P&L correctly. See how to do this.

Are holdings up to date?

LUSID may be valuing X units of a holding when you are expecting it to value Y units. A transaction representing a purchase or sale for missing units may not have been loaded into LUSID in time.

In the LUSID web app, you can audit the constituent transactions for a holding by clicking the value in the Units column (in yellow), for example:

In the API, you can call the GetHoldingContributors API with a particular holding ID.