Creating hierarchical custom data models for instruments

Prev Next

In this tutorial we’ll create the following custom data models (CDMs):

  1. A parent CDM applicable to all instruments that mandates a FIGI identifier and a country code property.

  2. A child CDM applicable to all entities that further mandates an exchange code property.

  3. A child CDM applicable to all bonds that further mandates an ISIN identifier.

With these CDMs in place, you can create entities under (that is, in the context) of these models in order to enforce the requirements.

Step 1: Creating a parent custom data model applicable to all instruments

We could call the CreateCustomDataModel API, but the LUSID web app offers the best experience:

  1. Navigate to Data Management > Custom Data Models and select Instrument:

  2. Right-click on the Instrument widget and select Add child from the context menu:

  3. On the left-hand side of the screen, give the custom data model a Scope, a Code that is unique within the scope, a Display name and Description:

Making the custom data model applicable to all instruments

On the Conditions tab, the default behaviour is to make the custom data model applicable to all instruments.

Since this is the required behaviour for our custom data model, there is no need to add a condition.

Mandating particular identifiers

On the Identifiers tab, click the Add identifiers button to add the FIGI identifier and make it Required:

Mandating particular properties

On the Properties tab, click the Add properties button to add a suitable country code property and make it Required:

You can add multiple properties using the Add wildcard button, for example Leg/* to add all properties from the Leg domain, or Instrument/MyScope/* to add all properties from the Instrument domain in the specified scope. Note, however, that multiple properties added using wildcards cannot be made Required, so these properties appear prominently in create/edit dialogs but LUSID users are not forced to enter values.

Specifying more intuitive names for data fields, identifiers and properties

On the Aliases tab we can optionally specify more intuitive names for instrument data fields, identifiers and properties, for example:

These names are used instead of the LUSID default names on screens where instruments are listed.

Configuring the sort order when instruments are listed

On the Sort order tab we can optionally change the default way in which screens containing lists of instruments are sorted. More info coming soon.

Creating the custom data model

Click the Save button to create the model and examine the new hierarchy:

Step 2: Creating a child custom data model applicable to bonds

  1. Right-click on the newly-created All Instruments widget and select Add child from the context menu.

  2. On the left-hand side of the screen, give the child custom data model a Scope, a Code that is unique within the scope, a Display name and Description. Note the Entity type, Level and Parent code fields are inherited from the parent custom data model.

  3. On the Conditions tab, click the Add condition button to restrict applicability using any combination of instrument data fields, identifiers and/or properties. For example, to restrict the model just to instruments of type Bond:

    Note that to restrict the model to all LUSID types of bond (Bond, ComplexBond and InflationLinkedBond) we would need to use Advanced mode and create an expression using LUSID filter syntax, for example instrumentDefinition.instrumentType in 'Bond','ComplexBond','InflationLinkedBond'.

  4. On the Identifiers tab, add the ISIN identifier and make it Required:

  5. Click the Save button to create the model and examine the new hierarchy:

Step 3: Creating a child custom data model applicable to equities

  1. Right-click on the All Instruments widget and select Add child from the context menu.

  2. On the left-hand side of the screen, give the child custom data model a Scope, a Code that is unique within the scope, a Display name and Description. Note the Entity type, Level and Parent code fields are inherited from the parent custom data model.

  3. On the Conditions tab, click the Add condition button to restrict applicability using any combination of instrument data fields, identifiers and/or properties. For example, to restrict the model just to instruments of type Equity:

  4. On the Identifiers tab, add a suitable exchange code property and make it Required:

  5. Click the Save button to create the model and examine the new hierarchy: