Documentation Index

Fetch the complete documentation index at: https://support.lusid.com/llms.txt

Use this file to discover all available pages before exploring further.

How do I create a transaction fee type?

Prev Next

You can create a transaction fee type for a particular fee (for example, a broker fee) that determines how LUSID should calculate fee amounts, and nominates a property in which to store the result for applicable transactions.

Note the transactions to which the fee applies, and whether fee amounts are capitalised or not, is determined by calculations on the transaction type.

Methods

Call the CreateTransactionFeeType API:

curl -X POST 'https://<your-domain>.lusid.com/api/api/transactions/MyFeeTypes/MyBrokerFee'
  -H 'Content-Type: application/json-patch+json'
  -H 'Authorization: Bearer <your-API-access-token>'
  -d '{
  "displayName": "Broker fee",
  "description": "Broker commission fee for transactions",
  "calculation": {
    "formula": "Transaction.totalConsideration.amount * 0.002"
  },
  "condition": "Properties[Transaction/default/ExecutionBroker] eq 'BrokerA' and Transaction.transactionCurrency eq 'USD'",
  "txnPropertyKey": "Transaction/MyFees/BrokerResult",
  "properties": {},
  "isActive": true
}'

Navigate to Data Management > Transaction Fees and click the Create transaction fee button:

Coming soon

Data fields and properties

This section supplements the API documentation and on-screen help text in the LUSID web app.

Fields

A transaction fee type is identified by a scope and a code that must be unique within that scope.

You must specify a txnPropertyKey that is the three-stage key of a property type in the Transaction domain to store the result of the calculation. You can examine this on an output transaction.

Set isActive to False to deactivate the fee calculation. By default, it is active.

You must specify a calculation.formula that determines how LUSID should calculate the fee. Note the field is a string but the expression must evaluate to a number. You can hard-code an amount or use the + - / * ^ mathematical operators on literals or on transaction fields and properties that return numbers. You can optionally use LUSID derived property conditional statements if desired.

Example

Fee amount is…

calculation.formula = "10"

Always 10

calculation.formula = "(10 / 5) + 0.5"

Always 2.5

calculation.formula = "Properties[Transaction/default/GrossConsideration] * (2 / 100)"

2% of the gross consideration

calculation.formula = "If(Transaction.Instrument.InstrumentDefinition.InstrumentType eq 'Equity') then Transaction.totalConsideration.amount / 10 else Properties[Transaction/default/GrossConsideration] / 10"

10% of the total consideration if the transaction is in an equity, otherwise 10% of the gross consideration

You must specify a condition:

  • Specify True to always calculate the fee amount for applicable transactions.

  • Use LUSID filter syntax to only calculate the fee amount in certain circumstances. You can include any field or property from a portfolio or transaction in the condition, including the transaction’s underlying instrument type. You can optionally chain expressions using the and and or operators if desired.

Example

Fee amount is…

condition="True"

Always calculated for every applicable transaction

condition = "Transaction.Instrument.InstrumentDefinition.InstrumentType eq 'Equity'"

Only calculated for transactions in equities

condition = "Transaction.totalConsideration.amount gt 2000"

Only calculated for transactions with a total consideration of more than 2000

condition = "Transaction.units gte 100 and Transaction.Properties[Transaction/Broker/Commission] exists"

Only calculated for transactions of 100 units or more that record broker commission

condition = "Portfolio.baseCurrency eq 'GBP'"

Only calculated for transactions in GBP portfolios

condition = "Portfolio.Properties[Portfolio/Manager/Name] in 'John Doe', 'Jane Doe'"

Only calculated for transactions in portfolios managed by John Doe or Jane Doe

condition = "Transaction.units gt 100 and Portfolio.created gte 2024-01-01"

Only calculated for transactions of more than 100 units in 2024+ portfolios

Properties

You can optionally extend the data model of a transaction fee type by adding properties from the TransactionFeeType domain.

Subsequent updates

You can update some aspects of a transaction fee type by calling the UpdateTransactionFeeType API. Note you cannot change the scope, code, displayName or txnPropertyKey fields.

For information about updating or deleting properties, see this article.