A metric in LUSID is a discrete piece of business information you can retrieve when creating a valuation report and, potentially, perform operations on to add value and gain insight.

LUSID can report many hundreds of metrics about almost any aspect of the valuation process, from information about underlying instruments and transactions, portfolios and the holdings they contain, market data used, and headline statistics such as PV and PnL.

Note: You can include properties in valuation reports too, and create custom metrics using a special kind of derived property. More information.

Listing available metrics

To list every metric, call the GetQueryableKeys API, or query the Lusid.Portfolio.Valuation.Measure provider if you have a Luminesce license. Note the following:

  • Not every metric is useful or valid for the types of instruments you wish to value. You can call APIs in advance to understand which metrics might be relevant to your use case.
  • There are hundreds of metrics, so it is often useful to apply a filter when retrieving them; see the table below for examples.
  • Some metrics are deprecated. You can ignore these by adding the following expression to a filter: and lifeCycleStatus neq 'Deprecated'.
DomainSub-category (where relevant)Filter to applyExample metricsNotes
Aggregation domain eq 'Aggregation'Aggregation/GrossExposureFraction
Analytic domain eq 'Analytic'Analytic/YieldToMaturity
Counterparty domain eq 'Counterparty'Counterparty/Signatory/Name
Holding domain eq 'Holding'Holding/Cost/Dom
InstrumentOTCdomain eq 'Instrument' and addressKey ct 'OTC'Instrument/OTC/Bond/StartDate
Information specific to instrument types.
Otherdomain eq 'Instrument' and addressKey not ct 'OTC'Instrument/InstrumentType
Generic information about instruments.
LegalEntity domain eq 'LegalEntity'LegalEntity/DisplayName
Lookthrough domain eq 'Lookthrough'Lookthrough/LookthroughWeight
'Lookthrough' refers to securitised portfolios.
Portfolio domain eq 'Portfolio'Portfolio/Name
ProfitAndLoss domain eq 'ProfitAndLoss'ProfitAndLoss/Total/Market
Replacement for Valuation/PnL* metrics. More information.
Quotes domain eq 'Quotes'Quotes/Price
Transaction domain eq 'Transaction'Transaction/TotalConsideration
ValuationPVdomain eq 'Valuation' and addressKey ctsw 'PV'Valuation/PV
Riskdomain eq 'Valuation' and addressKey ct 'Risk'Valuation/Risk/Gamma
Accrualdomain eq 'Valuation' and addressKey ctsw 'Accr'Valuation/Accrued
More information.
Exposuredomain eq 'Valuation' and addressKey ctsw 'Exposure'Valuation/Exposure
More information.
Diagnosticsdomain eq 'Valuation' and addressKey ct 'Diagnostics'Valuation/Diagnostics/FxForwardRate
Instrument legsdomain eq 'Valuation' and addressKey ctsw 'Leg'Valuation/Leg1/PV
LUSID considers certain instruments to have legs.
PnLdomain eq 'Valuation' and addressKey ct 'PnL'Valuation/PnL/YearToDate
Being replaced by dedicated ProfitAndLost metrics.
UnitResultAll metricsdomain eq 'UnitResult'UnitResult/Valuation/InstrumentAccrued
User-defined metrics for external result data in the SRS.
Metrics in a particular data mapdomain eq 'UnitResult' and scope eq '<my-data-map-scope>'

Performing operations on metrics

The Valuation/PV metric is defined as follows:

     "addressKey": "Valuation/PV",
     "description": "The present value of a holding of an instrument, at a point in time, in the settlement currency if applicable, otherwise domestic currency. Includes accrued interest",
     "displayName": "PV",
     "type": "Result0D",
     "flattenedType": "Decimal",
     "scalesWithHoldingQuantity": true,
     "supportedOperations": "Sum,Proportion,Average,Count,Min,Max,Value,SumOfPositiveValues,SumOfNegativeValues,SumOfAbsoluteValues,ProportionOfAbsoluteValues",
     "lifeCycleStatus": "Experimental"

Every metric:

  • Has a multi-stage addressKey you can use to report the metric.
  • Has a set of supportedOperations. You can always report a metric's Value; in addition, you can typically perform operations such as Sum, Proportion and Average on numeric values. See a demonstration.

Specifying metrics in valuation reports

When you create a valuation report you must specify at least one metric. Note it's often useful to specify the Instrument/default/Name metric to report the friendly names of underlying instruments. 

Consider the following example, of a call to value this GBP-denominated portfolio containing a mix of US and UK equities and bonds on a single day, 7 March 2022:

  • The metrics chosen to create a meaningful valuation report are highlighted (with summary explanations) in red.
  • Results are grouped by the  Instrument/default/LusidInstrumentId metric (highlighted in yellow) to report one result per underlying instrument held. If the portfolio contains multiple holdings in the same underlying instrument (perhaps divided into tax lots or strategies), they are automatically aggregated.
  • Non-numeric metrics report their Value.
  • Numeric metrics use the Sum operation to total any holdings in the same underlying instrument divided into tax lots or strategies. Note this has no effect if holdings have not been so divided:
curl -X POST "https://<your-domain>$valuation"
   -H "Authorization: Bearer <your-API-access-token>"
   -H "Content-Type: application/json-patch+json"
   -d '{
     "portfolioEntityIds": [ {"scope": "FBNUniversity", "code": "Module-4-1", "portfolioEntityType": "SinglePortfolio"} ],
     "valuationSchedule": {"effectiveAt": "2022-03-07T00:00:00.0000000+00:00"},
     "recipeId": {"scope": "FBNUniversity", "code": "Module-4-1Recipe"},
     "groupBy": ["Instrument/default/LusidInstrumentId"],
     "metrics": [
       {"key": "Instrument/default/Name", "op": "Value"},             # Reports the friendly name of the underlying instrument
       {"key": "Valuation/EffectiveAt", "op": "Value"},               # Confirms the valuation date
       {"key": "Holding/default/Cost", "op": "Sum"},                  # Calculates cost in the transaction currency
       {"key": "Valuation/PV", "op": "Sum"},                          # Calculates PV in the transaction currency
       {"key": "Valuation/PnL/Unrealised", "op": "Sum"},              # Calculates PnL in the transaction currency (PV minus cost)
       {"key": "Holding/Cost/Pfolio", "op": "Sum"},                   # Calculates cost in GBP (the portfolio currency)
       {"key": "Valuation/PvInPortfolioCcy", "op": "Sum"},            # Calculates PV in GBP
       {"key": "Valuation/PnL/Unrealised/PfolioCcy", "op": "Sum"}     # Calculates PnL in GBP

The response might look like this (transformed to a Pandas dataframe and with columns renamed for simplicity):

For more on grouping results in a valuation report, and aggregating numeric values using mathematical operations, see this article.