How do I create or generate a recipe?

Prev Next

Required reading: What is a recipe?

Creating or editing a recipe by hand

  1. Navigate to Data Management > Recipes.

  2. Select Create to create a new recipe, or Edit on the row of an existing recipe. Note you can't edit your default recipe; first choose a different default under System Settings > Default Settings > Recipes.

A recipe is a complex JSON document with scores of settings, most of which default to sensible values:

Tab

Explanation

Basic data

Scope and Code are mandatory. The code must be unique within the scope.

Market rules

You must specify at least one market data rule. See how to do this.

Pricing rules

We strongly recommend changing the default pricing models for most instrument types. See how to do this.

Market options

Start with Changing recipe settings.

Pricing options

Holding options

Advanced options

JSON

Some recipe settings are not available on the tabs above. To specify settings marked JSON only in the first column of these tables, open the JSON tab, select Edit as JSON, add the field name to the correct section, and save. Settings you specify in this way are retained when you later save changes from other tabs.

Call the UpsertConfigurationRecipe API, specifying at a minimum:

  • A scope and code that together uniquely identify the recipe.

  • At least one market data rule in the marketRules array of the market section that enables LUSID to retrieve market data suitable to value the instruments held. We also strongly recommend changing the default pricing models for most instrument types.

For more information on all the other settings in a recipe, start with Changing recipe settings.

curl -X POST "https://<your-domain>.lusid.com/api/api/recipes" 
  -H "Content-Type: application/json-patch+json" 
  -H "Authorization: Bearer <your-API-access-token>" 
  -d '{
  "configurationRecipe": {
    "scope": "MyRecipes",
    "code": "ValuationRecipe",
    "description": "Simple recipe to value equities using price * units"
    "market": {
      "marketRules": [
        {
          "key": "Quote.Figi.*",
          "supplier": "Edi",
          "dataScope": "MyQuoteScope",
          "quoteType": "Price",
          "field": "mid",
          "quoteInterval": "2D.0D"
        }
      ]
    }
  }
}'

Coming soon

Asking LUSID to generate a recipe for you

You can specify a portfolio to value and characteristics of appropriate market prices in the LUSID Quote Store and ask LUSID to generate a recipe that calculates the value of each position by multiplying the price of the underlying instrument by the number of units held.

Note: Alternatively, you can supply a simple recipe and ask LUSID to create a more sophisticated recipe for you.

To do this, call the GenerateConfigurationRecipe API, specifying:

  • The scope and code of a transaction portfolio to value.

  • One or more quote scopes encapsulating prices for the underlying instruments loaded into the LUSID Quote Store.

For example, to value a portfolio with a scope of Growth and code of UKEquities using prices encapsulated in a quote scope of MyQuoteScope:

curl -X POST "https://<your-domain>.lusid.com/api/api/aggregation/Growth/UKEquities/$generateconfigurationrecipe" 
  -H "Content-Type: application/json-patch+json" 
  -H "Authorization: Bearer <your-API-access-token>"
  -d '{
  "recipeCreationMarketDataScopes": [
    "MyQuoteScope"
  ],
  "effectiveAt": "2022-11-01"
}'

LUSID might generate a recipe like the one below (note most recipe settings default to sensible values):

{
  "scope": "Growth",
  "code": "LUSID_generated_recipe",
  "description": "- recipe has been supplemented with additional market data rules",
  "market": {
    "marketRules": [
      {
        "key": "Quote.Figi.*",
        "supplier": "Lusid",
        "dataScope": "MyQuoteScope",
        "quoteType": "Price",
        "field": "mid",
        "priceSource": "",
        "sourceSystem": "Lusid"
      },
      {
        "key": "Fx.*.*",
        "supplier": "Lusid",
        "dataScope": "default",
        "quoteType": "Price",
        "field": "mid",
        "priceSource": "",
        "sourceSystem": "Lusid"
      }
    ],
    "suppliers": {},
    "options": {
      "defaultSupplier": "Lusid",
      "defaultInstrumentCodeType": "LusidInstrumentId",
      "defaultScope": "ScenarioTutorial",
      "attemptToInferMissingFx": true,
      "attemptToInferMissingFxOnFixings": false,
      "calendarScope": "CoppClarkHolidayCalendars",
      "conventionScope": "Conventions",
      "pricingBasis": "Mid"
    },
    "specificRules": [],
    "groupedMarketRules": []
  },
  "pricing": {
    "modelRules": [],
    "modelChoice": {},
    "options": {
      "modelSelection": {
        "library": "Lusid",
        "model": "SimpleStatic"
      },
      "useInstrumentTypeToDeterminePricer": false,
      "allowAnyInstrumentsWithSecUidToPriceOffLookup": false,
      "allowPartiallySuccessfulEvaluation": true,
      "riskEngine": "Bump",
      "findOrCalculate": "Off",
      "produceSeparateResultForLinearOtcLegs": false,
      "fxForwardContractsAsUnitsInBothLegs": false,
      "enableUseOfCachedUnitResults": false,
      "windowValuationOnInstrumentStartEnd": false,
      "removeContingentCashflowsInPaymentDiary": false,
      "useChildSubHoldingKeysForPortfolioExpansion": false,
      "validateDomesticAndQuoteCurrenciesAreConsistent": false,
      "mbsValuationUsingHoldingCurrentFace": false,
      "fixedIncomeValuationsUsingCurrentFace": false,
      "convertSrsCashFlowsToPortfolioCurrency": false,
      "conservedQuantityForLookthroughExpansion": "PV",
      "returnZeroPv": {
        "instrumentMatured": false
      },
      "enableLegLevelInferenceForCustomSrsColumns": false,
      "useInstrumentScaleFactorAsDefault": false,
      "scaleInstrumentAccruedOverrideByContractSize": false,
      "defaultPoolFactorsToUnity": false,
      "findOrCalculateWriteThrough": false,
      "allowFallbackOnModelDecline": false,
      "suppressAutomaticLoanPrincipalRepayment": false
    },
    "resultDataRules": [],
    "holdingPricingInfo": {
      "fallbackField": "None",
      "overrideField": "None",
      "specificFallbacks": [],
      "specificOverrides": []
    }
  },
  "aggregation": {
    "options": {
      "useAnsiLikeSyntax": false,
      "allowPartialEntitlementSuccess": false,
      "applyIso4217Rounding": false
    }
  },
  "holding": {
    "taxLotLevelHoldings": true
  }
}