How do I create a transaction portfolio?

You can create a transaction portfolio to build holdings (positions) in an underlying set of instruments.

Note: Once created, you can only change certain characteristics of a transaction portfolio in restricted circumstances. More information.

To create a transaction portfolio, you must specify a unique identifier, friendly name and base (or reporting) currency. You can optionally:

  • Specify a creation date prior to today (the default). This is important if you intend to load historical activity.

  • Register an instrument scope in order to resolve transactions to instruments mastered in that scope, before falling back to the default instrument scope.

  • Register a transaction type scope in order to resolve transactions to transaction types domiciled in that scope. Note LUSID does not fall back to searching the default transaction type scope. Only if omitted does LUSID search the default scope.

  • Register one or more sub-holding keys (SHKs) in order to split holdings into categories. By default, LUSID generates one holding per instrument per settlement currency.

  • Register a portfolio recipe. Note this is required in certain circumstances, such as to enable instrument events.

  • Register a transaction template scope in order to configure the process of handling instrument events, before falling back to the default transaction template scope.

  • Subscribe to a corporate action source containing corporate actions impacting underlying instruments held in the portfolio.

  • Change the default AverageCost accounting method to one of the supported tax lot accounting methods.

  • If the portfolio contains bond holdings, change the default NoAmortisation method to one of the supported amortisation methods.

  • Add custom properties to store additional information about the portfolio not recorded by the standard set of data fields. These properties must be from the Portfolio domain.

To examine the complete set of data fields for a transaction portfolio, examine the API documentation. Note that to subsequently interact you can use the APIs in the Portfolios collection as well as the Transaction Portfolios collection.

Using the LUSID REST API

Call the CreatePortfolio API, nominating a scope in the URL and specifying in the request body:

  • A displayName.

  • A code unique within the scope.

  • A baseCurrency to which foreign currency transactions can be normalised upon provision of a trade to portfolio rate. This must be an ISO 4217 currency code, for example GBP or JPY.

  • Optionally, any of the objects explained above.

For example, to create a GBP-denominated portfolio with a code of Income and a creation date at the start of 2023 in myportfolioscope (specified in the URL; this is created if it does not exist):

curl -X POST 'https://<your-domain>.lusid.com/api/api/transactionportfolios/myportfolioscope'
-H 'Authorization: Bearer <your-API-access-token>'
-H 'Content-Type: application/json-patch+json'
-d '{
  "displayName": "Portfolio UK",
  "description": "Portfolio for UK market",
  "code": "my-portfolio-code",
  "created": "2023-01-01T00:00:00.0000000+00:00",
  "baseCurrency": "GBP",
  "corporateActionSourceId": {
    "scope": "my-cas-scope",
    "code": "my-cas-code"
  },
  "accountingMethod": "FirstInFirstOut",
  "subHoldingKeys": ["Transaction/Strategy/Signal"],
  "properties": {
    "Portfolio/Manager/Name": {
      "key": "Portfolio/Manager/Name",
      "value": {
        "labelValue": "Matt Smith"
      }
    }
  },
  "instrumentScopes": ["my-secret-instr-scope"],
  "amortisationMethod": "StraightLine",
  "transactionTypeScope": "my-secret-type-scope",
  "instrumentEventConfiguration": {
    "transactionTemplateScopes": ["my-secret-template-scope"],
    "recipeId": {
      "scope": "my-recipe-scope",
      "code": "my-recipe-code"
    }
  }
}'

Note the response does not contain all the fields, so call the GetDetails API to confirm the transaction portfolio has been created as specified, for example:

{
  "originPortfolioId": {
    "scope": "myportfolioscope",
    "code": "my-portfolio-code"
  },
  "baseCurrency": "GBP",
  "corporateActionSourceId": {
    "scope": "my-cas-scope",
    "code": "my-cas-code"
  },
  "subHoldingKeys": [
    "Transaction/Strategy/Signal"
  ],
  "instrumentScopes": [
    "my-secret-instr-scope"
  ],
  "accountingMethod": "FirstInFirstOut",
  "amortisationMethod": "StraightLine",
  "transactionTypeScope": "my-secret-type-scope",
  "cashGainLossCalculationDate": "Default",
  "instrumentEventConfiguration": {
    "transactionTemplateScopes": [
      "my-secret-template-scope"
    ],
    "recipeId": {
      "scope": "my-recipe-scope",
      "code": "my-recipe-code"
    }
  },
  ...
}

Using Luminesce

You can use the Lusid.Portfolio.Writer provider.

Using the LUSID web app

  1. Sign in to the LUSID web app using the credentials of a LUSID administrator.

  2. From the top left menu, select Data Management > Portfolios.

  3. Click the Create Portfolio button (top right).

  4. On the Basic data screen of the Create Portfolio dialog, choose Transaction from the Type dropdown menu, and specify a Scope, Code and Effective date:

  5. On the Details screen, specify a Base currency using an ISO 4217 currency code, for example GBP or JPY.

  6. Complete the other optional fields if desired and click the Create button.