Type | Read/write | Author | Availability |
Data provider | Read | Finbourne | Provided with LUSID |
The Lusid.Instrument.Property
provider enables you to write a Luminesce SQL query that retrieves properties for instruments mastered in LUSID.
Note: The LUSID user running the query must have sufficient access control permissions to both use the provider and read instrument and property data stored in LUSID. This should automatically be the case if you are the domain owner.
Note that, by default, the core Lusid.Instrument
provider does not retrieve properties. You can use Lusid.Instrument.Property
to do so in conjunction with any other provider (including Lusid.Instrument
) to analyse all the data associated with instruments.
See also: Lusid.Portfolio.Holding.Property
, Lusid.Portfolio.Txn.Property
Basic usage
select * from Lusid.Instrument.Property where <instrument-or-property>;
You must specify either:
- The
InstrumentIdType
andInstrumentId
fields to identify a particular instrument whose properties to return. - The
PropertyScope
andPropertyCode
fields to identify a particular property whose instruments to return.
Note if you do not specify the InstrumentScope
field, only instruments in the built-in default
instrument scope are returned.
Query parameters
Lusid.Instrument.Property
has parameters that enable you to filter or refine a query.
To list available parameters, their data types, default values, and an explanation for each, run the following query using a suitable tool:
select FieldName, DataType, ParamDefaultValue, Description from Sys.Field where TableName = 'Lusid.Instrument.Property' and FieldType = 'Parameter';
Data fields
By default, Lusid.Instrument.Property
returns a table of data populated with particular fields (columns). You can return just a subset of these fields if you wish.
To list fields available to return, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a suitable tool:
select FieldName, DataType, IsMain, IsPrimaryKey, SampleValues, Description from Sys.Field where TableName = 'Lusid.Instrument.Property' and FieldType = 'Column';
Note: Fields marked 'main' are returned by queries that start select ^ from Lusid.Instrument.Property...
Examples
Note: For more example Luminesce SQL queries, visit our Github repo.
Example 1: Retrieve all the properties decorated onto a particular instrument
You must specify both InstrumentIdType
and InstrumentId
to identify a particular instrument:
select * from Lusid.Instrument.Property where InstrumentIdType = 'LusidInstrumentId' and InstrumentId = 'LUID_6OHFNCI7';
Example 2: Retrieve instruments that have a particular property
You must specify both PropertyScope
and PropertyCode
to identify a particular instrument property:
select * from Lusid.Instrument.Property where PropertyScope = 'IBORUserJourney' and PropertyCode = 'Coupon' and Value > 50;
Example 3: Retrieve properties for all the instruments in a custom instrument scope
You must specify InstrumentScope
if an instrument is not in the built-in default
instrument scope.:
select * from Lusid.Instrument.Property where InstrumentScope = 'my-secret-scope' and InstrumentIdType = 'LusidInstrumentId' and InstrumentId in (select LusidInstrumentId from Lusid.Instrument where Scope = 'my-secret-scope');
Example 4: Decorate particular instrument properties onto holdings
You can join Lusid.Instrument.Property
to an entity provider such as Lusid.Portfolio.Holding
to decorate holdings with particular instrument properties:
select h.*, pC.Value as Coupon, pI.Value as Industry from lusid.portfolio.holding h left outer join Lusid.Instrument.Property pC on pC.InstrumentIdType = 'LusidInstrumentId' and pC.InstrumentId = h.LusidInstrumentId and pC.PropertyCode = 'Coupon' left outer join Lusid.Instrument.Property pI on pI.InstrumentIdType = 'LusidInstrumentId' and pI.InstrumentId = h.LusidInstrumentId and pI.PropertyCode = 'Industry' where h.PortfolioScope = 'Finbourne-Examples'