This article explains structured result data documents, how to create, edit, store and retrieve them, and how they are used within LUSID
What is Structured Result Data?
In the course of managing a portfolio of instruments, there are various intermediate results that feed into decisions made on whether performance of a portfolio is adequate and whether comparable investments might be preferable. Examples include the accrued interest, the yield to maturity (YTM) or yield to exercise date (YTD) for bond pricing, the delta sensitivity of a swap, and the year to date performance of an ETF or other index.
This data is not quote data in that is is not traded.
The structured result store provides a location for this data to be persisted within LUSID and queried when performing a valuation. There are two typical use cases
(1) The user prefers the data that they have calculated for a given result over that directly calculated by, or via, LUSID. For instance, a user might wish to favour their view about calculation of interest or risk over that provided by some library or fill in a gap where a prefered library does not provide risk to a particular instrument.
(2) Some information can be much quicker to lookup than calculate. For instance pricing a swap requires curve calibration to be performed. Where results are believed to be static or can be supplied up-front calculation time can be reduced.
What does Structured Result Data look like?
Structured result data is a JSON or XML document that describes a collection of result points. The exact definition will largely depend upon the user. From the point of view of LUSID it can be thought of as analogous to the properties supplied when uploading instruments or transactions.
Data is provided to LUSID in the form of block documents that resemble a CSV file.
How do I store and retrieve structured result data?
Given a document that one wishes to store, it can be upserted to LUSID using the structured result data endpoint. The user must specify the key that uniquely describes what the data is such that it can be discovered during pricing. The key contains several bits of data that can be used to search and find it via the structured result data endpoint. However, the crucial information is that which is used to link the document into the discovery mechanism used by the valuation.
For valuation to be able to discover these types they must be provided in the manner that LUSID expects.
Examples of this are to be added here.