|Data provider||Write||Finbourne||Provided with LUSID|
Note: The LUSID user running the query must have sufficient access control permissions to both use the provider and administer holdings in LUSID. This should automatically be the case if you are the domain owner.
You must construct a valid table of data to write, one holding per record.
Lusid.Portfolio.Holding.Writer lists the fields (columns) available to populate with values for each record, and has parameters to help you construct a valid table.
Your query can use the
WriteAction field to perform one of the following operations:
- Set holdings in a portfolio. Note that any existing holdings in the portfolio not included in the table of data to write are removed (reduced to zero).
- Adjust holdings. No changes are made to existing holdings in the portfolio not included in the table of data to write.
- Cancel holding adjustments (that is, undo) either of the above operations performed on a particular date.
Note that records with the same sub-holding keys that resolve to the same instrument are treated as tax lots, and all fields in these records must have matching values.
See also: Lusid.Portfolio.Holding
Lusid.Portfolio.Holding.Writer has parameters to help you construct a valid table of data to write.
ToWrite parameter is mandatory and used to actually write data to LUSID.
To list available parameters, their data types, default values, and an explanation for each, run the following query using a suitable tool:
Lusid.Portfolio.Holding.Writer lists the fields you can populate in your table of data to write.
Depending on the operation you want to perform, the following fields are mandatory to include in your table of data:
|Operation||Specify using...||Mandatory fields for all operations||Mandatory fields for this operation|
|Cancel adjustments (set or adjust)||n/a|
To list all available fields, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a suitable tool:
Note the following:
CostPriceis the price per unit.
CostCurrencyare the total cost (price * units) in the transaction currency
CostAmountPortfolioCurrencyis the total cost in the portfolio base currency.
We recommend examining the results of every write query using one or more of the
For each record in the table of data to write,
Lusid.Portfolio.Holding.Writer returns an error code. If the operation is successful, the error code is 0. If unsuccessful, a positive error code and explanation help you discover why LUSID considers the operation invalid.
For example, the query:
...fails because there is no value for
Note: For more example Luminesce SQL queries, visit our Github repo.
Example 1: Adjust a GBP cash holding
Example 2: Set an equity holding, overwriting all other holdings
'Set' as WriteAction does not perform an upsert operation but rather replaces the entire contents of the transaction portfolio with the new dataset. Any existing holdings not included in the new dataset are removed (reduced to zero).
Note also that, in this example,
Strategy is a transaction property that:
- Has been defined as a sub-holding key for the portfolio.
- Has been 'inlined' into the standard set of data fields for the provider by prior configuration of