A calculation is an optional component of a transaction type that triggers additional functionality for all transactions belonging to that type. 

A calculation:

  • Must have a type that triggers a particular function.

  • Can have a side to pass extra information to the function.

  • Can have a formula that drives the function.

Note: The result of a calculation can be examined on an output transaction.

Calculation type

Requires side?

Requires formula?

Functionality and syntax example

TaxAmounts

Yes

No

Calculates a tax amount due. Note this is ignored for a particular transaction if no tax rule can be found to apply. More information.
 

"calculations": [
  {
    "type": "TaxAmounts",
    "side": "Side1"
  }
]

Txn:TradeToPortfolioRate

No

No

Looks up an exchange rate from the transaction to the portfolio currency for the transaction date in the LUSID Quote Store. Note this is ignored for a particular transaction if the Transaction/default/TradeToPortfolioRate system property is specified. More information.
 

"calculations": [
  {
    "type": "Txn:TradeToPortfolioRate"
  }
]

Txn:ExchangeRate

No

No

Looks up an exchange rate from the transaction to the settlement currency for the transaction date in the LUSID Quote Store. Note this is ignored for a particular transaction if the exchangeRate field is set. More information.
 

"calculations": [
  {
    "type": "Txn:ExchangeRate"
  }
]

Txn:GrossConsideration

No

No

Calculates gross consideration. Note this is ignored for a particular transaction if the Transaction/default/GrossConsideration system property is specified.
 

"calculations": [
  {
    "type": "Txn:GrossConsideration"
  }
]

Txn:NotionalAmount

No

No

Calculates notional amount for a future or CFD instrument. Note this is ignored for a particular transaction if the Transaction/default/NotionalAmount system property is specified.
 

"calculations": [
  {
    "type": "Txn:NotionalAmount"
  }
]

DeriveTotalConsideration

No

Yes

Calculates total consideration (gross consideration minus any fees) according to a formula. Note this is ignored for a particular transaction if the totalConsideration.amount field is set, and for all transactions if the total consideration system setting is disabled (more information coming soon).
 

"calculations": [
  {
    "type": "DeriveTotalConsideration",
    "formula": "Txn:GrossConsideration - Properties[Transaction/Fees/TotalCapitalisedFees]"
  }
]