How do I perform a valuation?

Prev Next

You can value one or more transaction portfolios, all the portfolios in a portfolio group, or notional quantities of arbitrary instruments. Troublehooting valuation errors.

Methods

To value:

  • One or more portfolio and/or portfolio groups, call the GetValuation API.

  • Notional quantities of arbitrary instruments, call the GetValuationOfWeightedInstruments API, specifying quantities and economic definitions in the instruments section.

The following example call to GetValuation:

  • Values this sample transaction portfolio every day between Monday 7 March and Friday 11 March 2022 inclusive.

  • Returns metrics that report the valuation date, holding cost, PV and P&L(PV minus cost) in portfolio currency.

  • Groups by valuation date and sums the numeric metrics to produce a total for the portfolio each day. Note it only makes sense to sum metrics in the same currency.

  • Sorts results by the valuation date, earliest first.

curl -X POST "https://<your-domain>.lusid.com/api/api/aggregation/$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": {
      "effectiveFrom": "2022-03-07T00:00:00.0000000+00:00", 
      "effectiveAt": "2022-03-11T00:00:00.0000000+00:00" 
    },
    "recipeId": {
      "scope": "FBNUniversity", 
      "code": "Module-4-1Recipe"
    },
    "metrics": [
      {"key": "Valuation/EffectiveAt", "op": "Value"},
      {"key": "Holding/Cost/Pfolio", "op": "Sum"},
      {"key": "Valuation/PvInPortfolioCcy", "op": "Sum"},
      {"key": "ProfitAndLoss/Total/PortfolioCcy", "op": "Sum", "options": {"Window": "Daily"}},
    ],
    "groupBy": ["Valuation/EffectiveAt"],
    "sort": [ {"key": "Valuation/EffectiveAt", "sortOrder": "Ascending"} ]
  }'

The response might look like this (transformed to a table and with columns renamed for clarity):

Note you can only value a single portfolio or portfolio group using the web app. To value multiple portfolios or groups, use the API or Luminesce.

Navigate to Dashboard > Valuation and follow the instructions to select a portfolio or group, a recipe, and either an effective date or a range of dates.

LUSID returns the set of metrics specified by the current view (highlighted in yellow below). To change the selection, click the cog (in green) and then Add column to add/remove metrics (labelled ‘queryable keys’), properties and other information.

Write a Luminesce SQL query using the  Lusid.Portfolio.Valuation provider and execute it from a tool such as the LUSID web app:

Data fields

This section supplements the API documentation and on-screen help text in the LUSID web app.

Mandatory fields

Explanation

portfolioEntityIds

The scope and code of each portfolio and/or portfolio group to value. For a portfolio group, set portfolioEntityType to GroupPortfolio.

recipeId

The scope and code of a recipe that, at a minimum, locates market data suitable for instruments being valued for each day in the valuation schedule.

valuationSchedule

At a minimum, the effectiveAt of a single valuation date. If you omit the time component, valuation occurs at 00:00:00.

To specify a range of dates and have LUSID produce a separate report for each weekday in the range, set effectiveFrom to the start date and effectiveAt to the end date. By default, Saturdays and Sundays are omitted.

You can optionally specify tenors, holiday calendars and roll and business day conventions to adjust scheduled valuation dates that do not occur on good business days. More information.

metrics

At least one metric that reports meaningful information for instruments being valued. You can include properties in valuation reports too.

Selected optional fields

reportCurrency

By default, and providing suitable market data is available, LUSID calculates results in both holding and portfolio currencies and, where appropriate, tracks exchange rates between the two over time. For example, the Holding/Cost/Dom metric reports total cost in holding currency and Holding/Cost/Pfolio calculates portfolio cost using the FX rate valid on the trade date of each contributing transaction.

You can specify the ISO 4217 code of a different currency to the portfolio to act as a report currency, though note that conversions from holding to report currency are calculated naively using FX spot rates for the valuation date only. So for example the Holding/CostInReportCcy metric simply converts the cost in holding currency to the report currency on the valuation date, which means it may differ to the portfolio cost.

groupBy

One or more of metrics to group and aggregate by, in the order specified. This is especially useful to aggregate results for the same underlying instrument where holdings have been divided into tax lots, or by SHKs or custodians.

equipWithSubtotals

Set to True to return one row for each level of your groupBy hierarchy plus a grand-total row, alongside the normal grouped rows. If a row is a subtotal for a groupBy metric, __ALL__ is reported instead of a real value.

Metric operations behave as follows:

  • Sum operations (Sum, SumOfPositiveValues, SumOfNegativeValues, SumOfAbsoluteValues) add up the rows underneath.

  • Proportion and ProportionOfAbsoluteValues operations are measured against the whole portfolio total, not the parent group.

  • Value operations on groupBy metrics report __ALL__ for the levels being subtotalled.

sort

Sort valuation results by one or more metrics, in the order specified.

filters

Filter out certain results. In the following example, holdings with less than 100 units are excluded (note that most numeric metrics are decimal data types and so the decimal point is required):

"filters": [
  {
     "left": "Holding/default/Units",
     "operator": "GreaterThanOrEqualTo",
     "right": 100.0
  }
]

includeOrderFlow

Include orders and/or allocations in addition to booked transactions. More information.