Purpose: Managing a large list of models or using the complexity of the model structure within Eclipse can be a challenge. This article will guide you through how to create Eclipse models through the API, including using multiple tiers of sub-models.
Simple Use Case: Firm has created a platform to allow their portfolio managers to create new models and send the results to the Eclipse API
Scope and Outputs: What are the limits of this solution – what does it both do and NOT do?What is the end result?
Process Overview:
- Get Eclipse Token
- Create a new model
- Add model details
- Using existing submodels
- Using new submodels
Process Steps: Before starting this process it is imperative that you understand model construction in Eclipse. For additional training and documentation for this, please contact Orion’s trading support team.
Eclipse models can be kept very simple or be complex structures of multiple tiers of sub-models. In Eclipse a model is made up of 1) A model record, 2) Zero or many sub-model, and 3) one or more security Sets.
This article will assume we are constructing models from existing sub-models, and existing security sets.
- Authenticate to Eclipse and get a token. Refer to Getting an Eclipse Token found elsewhere in this resource for more details. It is important to note that tokens to make calls to the Eclipse API are unique but can be collected using an Orion Connect token.
- Create a model record with a POST call to the modeling endpoint.
Request URL:https://api.orioneclipse.com/v1/modeling/models
Request Method:POST
Headers:
{
"Authorization": Session << token >>
"Content-Type": application / json
}
Body: {
"name": "Eclipse Test",
"nameSpace": "dsf",
"description": null,
"statusId": 1, // 1 = Approved, 2 = Not Active, 3 = Not Approved, 4= Draft
"managementStyleId": 2,
"isCommunityModel": null,
"isDynamic": 0 } response: {
"id": 39,
"name": "Eclipse Test",
"description": null,
"nameSpace": "dsf",
"statusId": 4,
"status": "Draft",
"currentStatusId": null,
"currentStatus": null,
"tags": null,
"ownerUserId": 15057,
"ownerUser": "<<user.name>>",
"managementStyleId": 2,
"managementStyle": "Aggressive",
"isCommunityModel": 0,
"communityModelId": null,
"isSubstitutedForSleeve": 0,
"lastSyncDate": "2019-04-15T14:08:06.000Z",
"approvedByUserId": null,
"approvedByUser": null,
"isDynamic": 0,
"isDeleted": null,
"createdOn": "2019-04-15T14:08:06.000Z",
"editedOn": "2019-04-15T14:08:06.000Z",
"createdBy": "Dani.Palmer",
"editedBy": "Dani.Palmer",
"hasEditAccess": 1,
"macStatus": 3,
"modelDetail": null,
"portfolioCount": 0,
"sleeveCount": 0,
"modelAUM": 0 }
3a. Add model details with existing sub-models, by first calling for these details;
GET Request to URL https://api.orioneclipse.com/v1/modeling/models/submodels/{id}
Request URL:https://api.orioneclipse.com/v1/modeling/models/39/modelDetail/ see: https://api.orioneclipse.com/doc/#api-Models-AddModelDetail
Request Method:PUT
{
"modelDetail": {
"name": "Growth ETF Model From API",
"modelDetailId": null,
"targetPercent": null,
"lowerModelTolerancePercent": null,
"upperModelTolerancePercent": null,
"toleranceTypeValue": null,
"rank": null,
"lowerModelToleranceAmount": null,
"upperModelToleranceAmount": null,
"lowerTradeTolerancePercent": null,
"upperTradeTolerancePercent": null,
"isEdited": null,
"isSubstituted": null,
"substitutedOf": null,
"addedElements": [
1027,
231
],
"modifiedElements": [],
"removedElements": [],
"isNewlySubstitutedNode": false,
"isEditSubstituted": false
},
"substitutedModelId": null,
"substitutedFor": null,
"isSleeved": false,
"forcefulModelSave": false,
"targetPercentUpdated": false,
"children": [ <add objects from
Request URL:https://api.orioneclipse.com/v1/modeling/models/submodels/1027
Request Method:GET
>]
}
3b. Add model details with new sub-models. This option is available when you have a shell model created and the security sets already established. The most important area of the body for this call will be the children as you will be nesting your security sets inside of your newly created sub-models.
Request URL: https://api.orioneclipse.com/v1/modeling/models/:id/modelDetail/
Request Method: POST
Body:
{
"id":39,
"name":"Dani Test",
"description":null,
"nameSpace":"Default Team",
"statusId":1,
"status":"Approved",
"currentStatusId":null,
"currentStatus":null,
"tags":null,
"ownerUserId":5744,
"ownerUser":"<<userId>>",
"managementStyleId":null,
"managementStyle":null,
"isCommunityModel":0,
"communityModelId":null,
"isSubstitutedForSleeve":0,
"lastSyncDate":"2019-01-22T15:09:51.000Z",
"approvedByUserId":5744,
"approvedByUser":"<<userId>>",
"isDynamic":0,
"isDeleted":0,
"createdOn":"2019-01-22T15:09:51.000Z",
"editedOn":"2019-01-24T23:08:27.000Z",
"createdBy":"jpilson@vivaldicap.com",
"editedBy":"jpilson@vivaldicap.com",
"hasEditAccess":1,
"macStatus":3,
"portfolioCount":1,
"sleeveCount":0,
"modelAUM":1090301.74,
"modelDetail":{
"name":"Eclipse Test model",
"modelDetailId":null,
"targetPercent":null,
"lowerModelTolerancePercent":null,
"upperModelTolerancePercent":null,
"toleranceTypeValue":null,
"rank":null,
"lowerModelToleranceAmount":null,
"upperModelToleranceAmount":null,
"lowerTradeTolerancePercent":null,
"upperTradeTolerancePercent":null,
"isEdited":null,
"isSubstituted":null,
"substitutedOf":null,
"children":[
{ // child 1 will be your Sub Model
"id":null, //keeping id ‘null’ will create new submodel
"name":"Fixed Income_A12345",
"modelDetailId":null,
"modelTypeId":1,
"targetPercent":100,
"lowerModelTolerancePercent":2,
"upperModelTolerancePercent":2,
"toleranceTypeValue":4,
"lowerModelToleranceAmount":null,
"upperModelToleranceAmount":null,
"lowerTradeTolerancePercent":null,
"upperTradeTolerancePercent":null,
"rank":0,
"securityAsset":{
"id":null,
"name":"Fixed Income",
"meId":118,
"color":null
},
"isEdited":null,
"isSubstituted":null,
"substitutedOf":null,
"addedElements":[ // Security Set IDs
20,
14
],
"removedElements":[
],
"modifiedElements":[
],
"children":[
{ // These will be the Security Sets for the submodel you are creating
"id":null, // will create new
"name":"Passive Fixed Income",
"modelDetailId":null,
"modelTypeId":4,
"targetPercent":40,
"lowerModelTolerancePercent":0,
"upperModelTolerancePercent":0,
"toleranceTypeValue":0,
"lowerModelToleranceAmount":null,
"upperModelToleranceAmount":null,
"lowerTradeTolerancePercent":null,
"upperTradeTolerancePercent":null,
"rank":0,
"securityAsset":{
"id":20 //Security Set ID associated with Passive Fixed Income
},
"isEdited":null,
"isSubstituted":null,
"substitutedOf":null,
"addedElements":[
],
"removedElements":[
],
"modifiedElements":[
],
"children":[
],
"isNewlySubstitutedNode":false,
"isEditSubstituted":false
},
{
"id":null,
"name":"Core Taxable Fixed Income",
"modelTypeId":4,
"modelDetailId":null,
"targetPercent":60,
"lowerModelTolerancePercent":null,
"upperModelTolerancePercent":null,
"toleranceTypeValue":null,
"lowerModelToleranceAmount":null,
"upperModelToleranceAmount":null,
"lowerTradeTolerancePercent":null,
"upperTradeTolerancePercent":null,
"rank":0,
"securityAsset":{
"id":14 //Security set ID associated with Core Taxable Fixed Income
},
"isEdited":null,
"isSubstituted":null,
"substitutedOf":null,
"children":[
],
"addedElements":[
],
"modifiedElements":[
],
"removedElements":[
],
"isNewlySubstitutedNode":false,
"isEditSubstituted":false
}
],
"isNewlySubstitutedNode":false,
"isEditSubstituted":false
}
],
"isNewlySubstitutedNode":false,
"isEditSubstituted":false
},
"substitutedModelId":null,
"substitutedFor":null,
"isSleeved":false,
"forcefulModelSave":false,
"targetPercentUpdated":true
}
Response:
{
"id": 39,
"name": "Eclipse Test Model",
"description": null,
"nameSpace": "Default Team",
"statusId": 1,
"status": "Approved",
"currentStatusId": null,
"currentStatus": null,
"tags": null,
"ownerUserId": 15057,
"ownerUser": "<<username>>",
"managementStyleId": null,
"managementStyle": null,
"isCommunityModel": 0,
"communityModelId": null,
"isSubstitutedForSleeve": 0,
"lastSyncDate": "2019-04-12T17:45:45.000Z",
"approvedByUserId": 15057,
"approvedByUser": "<<username>>",
"isDynamic": 0,
"isDeleted": 0,
"createdOn": "2019-04-12T17:45:45.000Z",
"editedOn": "2019-04-15T14:35:34.000Z",
"createdBy": "<<username>>",
"editedBy": "<<username>>",
"hasEditAccess": 1,
"macStatus": 3,
"modelDetail": {
"modelDetailId": 254,
"id": 121,
"name": "Eclipse Test Model",
"nameSpace": "null",
"children": [
{
"id": 124,
"name": "Fixed Income_A12345",
"modelType": "Category",
"modelTypeId": 1,
"nameSpace": "null",
"securityAsset": null,
"leftValue": 2,
"rightValue": 7,
"modelDetailId": 253,
"targetPercent": 100,
"lowerModelTolerancePercent": 2,
"upperModelTolerancePercent": 2,
"lowerModelToleranceAmount": null,
"upperModelToleranceAmount": null,
"lowerTradeTolerancePercent": null,
"upperTradeTolerancePercent": null,
"rank": 0,
"toleranceType": null,
"toleranceTypeValue": 4,
"isSubstituted": null,
"substitutedOf": null,
"children": [
{
"id": 30,
"name": "Passive Fixed Income",
"modelType": "Security Set",
"modelTypeId": 4,
"nameSpace": null,
"securityAsset": {
"id": 20,
"meId": 30,
"color": null
},
"leftValue": 3,
"rightValue": 4,
"modelDetailId": 251,
"targetPercent": 40,
"lowerModelTolerancePercent": 0,
"upperModelTolerancePercent": 0,
"lowerModelToleranceAmount": null,
"upperModelToleranceAmount": null,
"lowerTradeTolerancePercent": null,
"upperTradeTolerancePercent": null,
"rank": 0,
"toleranceType": null,
"toleranceTypeValue": 0,
"isSubstituted": null,
"substitutedOf": null,
"children": []
},
{
"id": 24,
"name": "Core Taxable Fixed Income",
"modelType": "Security Set",
"modelTypeId": 4,
"nameSpace": null,
"securityAsset": {
"id": 14,
"meId": 24,
"color": null
},
"leftValue": 5,
"rightValue": 6,
"modelDetailId": 252,
"targetPercent": 60,
"lowerModelTolerancePercent": 0,
"upperModelTolerancePercent": 0,
"lowerModelToleranceAmount": null,
"upperModelToleranceAmount": null,
"lowerTradeTolerancePercent": null,
"upperTradeTolerancePercent": null,
"rank": 0,
"toleranceType": null,
"toleranceTypeValue": 0,
"isSubstituted": null,
"substitutedOf": null,
"children": []
}
]
}
],
"level": "0",
"leftValue": 1,
"rightValue": 8
},
"portfolioCount": 0,
"sleeveCount": 0,
"modelAUM": 0,
"modelsNeedAnalytics": [
"39"
],
"ids": [
14,
38,
39,
11
]
}