Transactions and manual vs automatic calculation of amounts

Prev Next

When you load transactions into LUSID, you can either manually specify all the numeric data points yourself, or alternatively ask LUSID to automatically calculate the following for you:

  • Total consideration, which is typically the trade amount payable or receivable after fees.

  • Gross consideration, which is defined as total consideration before fees.

  • Notional amount for transactions in Future and ContractForDifference instruments.

  • Accrued interest bought or sold for transactions in Bond, ComplexBond and InflationLinkedBond instruments.

To do this, add calculations to the transaction types to which those transactions belong. Note a calculation applies to every transaction belonging to the type; it cannot be made conditional.

Note the following:

  • While you are not required to capture all these data points for an individual transaction, certain LUSID downstream features may rely on them, in particular instrument events.

  • If you manually specify (for example) a total consideration and ask LUSID to calculate it for you, your manual amount prevails.

Consider the following example of a bond purchase transaction:

  • Number of units purchased: 100000

  • Price: 100

  • Trade commission: £50

  • Bond interest bought: £452.06

The input transactions for the two methods are quite different:

Manual specification of numeric data points

Automatic calculation of numeric data points by LUSID

You calculate totalConsideration.amount yourself, and record all the data points using a combination of system and custom properties:

james
{
  "transactionRequest-1": {
    "transactionId": "Txn-001",
    "type": "Buy",
    "instrumentIdentifiers": {"Instrument/default/Figi": "BBG000ABC123"},
    "transactionDate": "2024-06-15T00:00:00.0000000+00:00",
    "settlementDate": "2024-06-18T00:00:00.0000000+00:00",
    "units": 100000,
    "transactionPrice": {"price": 100, "type": "CleanPrice"},
    "totalConsideration": {"amount": 100502.06, "currency": "GBP"},
    "properties": {
      "Transaction/default/GrossConsideration": {
        "key": "Transaction/default/GrossConsideration",
        "value": {
          "metricValue": {
            "value": 100452.06,
            "unit": "GBP"
          }
        }
      },
      "Transaction/MyProperties/TotalCapitalisedFees": {
        "key": "Transaction/MyProperties/TotalCapitalisedFees",
        "value": {
          "metricValue": {
            "value": 50,
            "unit": "GBP"
          }
        }
      },
      "Transaction/default/BondInterest": {
        "key": "Transaction/default/BondInterest",
        "value": {
          "metricValue": {
            "value": 452.06,
            "unit": "GBP"
          }
        }
      }
    }
  }
}
JSON

You set totalConsideration.amount to 0, and only need record the trade commission using a custom property:

{
  "transactionRequest-1": {
    "transactionId": "Txn-001",
    "type": "Buy",
    "instrumentIdentifiers": {"Instrument/default/Figi": "BBG000ABC123"},
    "transactionDate": "2024-06-15T00:00:00.0000000+00:00",
    "settlementDate": "2024-06-18T00:00:00.0000000+00:00",
    "units": 100000,
    "transactionPrice": {"price": 100, "type": "CleanPrice"},
    "totalConsideration": {"amount": 0, "currency": "GBP"},
    "properties": {
      "Transaction/MyProperties/TotalCapitalisedFees": {
        "key": "Transaction/MyProperties/TotalCapitalisedFees",
        "value": {
          "metricValue": {
            "value": 50,
            "unit": "GBP"
          }
        }
      }
    }
  }
}
JSON

The Buy transaction type can have any economic impact you like, but might be defined as follows:

Buy transaction type for manual specification

Buy transaction type for automatic calculation

{
  "aliases": [
    {
      "type": "Buy",
      "description": "Transaction type for purchases",
      "transactionClass": "Basic",
      "transactionRoles": "AllRoles",
      "isDefault": false
    }
  ],
  "movements": [
    {
      "name": "Increase units",
      "movementTypes": "StockMovement",
      "side": "Side1",
      "direction": 1
    },
    {
      "name": "Decrease cash",
      "movementTypes": "CashCommitment",
      "side": "Side2",
      "direction": -1
    }
  ]
}
JSON

{
  "aliases": [
    {
      "type": "Buy",
      "description": "Transaction type for purchases",
      "transactionClass": "Basic",
      "transactionRoles": "AllRoles",
      "isDefault": false
    }
  ],
  "movements": [
    {
      "name": "Increase units",
      "movementTypes": "StockMovement",
      "side": "Side1",
      "direction": 1
    },
    {
      "name": "Decrease cash",
      "movementTypes": "CashCommitment",
      "side": "Side2",
      "direction": -1
    }
  ],
  "calculations": [
    {
      "type": "Txn:BondInterest"
    },
    {
      "type": "Txn:GrossConsideration"
    },
    {
      "type": "DeriveTotalConsideration",
      "formula": "Txn:GrossConsideration + Properties[Transaction/MyProperties/TotalCapitalisedFees]"
    }
  ]
}
JSON

Note that LUSID generates the same output transaction in both circumstances, so the impact on holdings is identical:

{
      "transactionId": "Txn001",
      "type": "Buy",
      "instrumentIdentifiers": {
        "Instrument/default/LusidInstrumentId": "LUID_00003E75",
        "Instrument/default/Figi": "BBG000ABC123"
      },
      "instrumentScope": "default",
      "instrumentUid": "LUID_00003E75",
      "transactionDate": "2024-06-15T00:00:00.0000000+00:00",
      "settlementDate": "2024-06-18T00:00:00.0000000+00:00",
      "units": 100000,
      "transactionAmount": 100050,
      "transactionPrice": {
        "price": 100,
        "type": "CleanPrice"
      },
      "totalConsideration": {
        "amount": 100502.06,
        "currency": "USD"
      },
      "exchangeRate": 1,
      "transactionToPortfolioRate": 1,
      "transactionCurrency": "USD",
      "properties": {
        "Transaction/Fees/TotalCapitalisedFees": {
          "key": "Transaction/Fees/TotalCapitalisedFees",
          "value": {
            "metricValue": {
              "value": 50
            }
          }
        },
        "Transaction/default/GrossConsideration": {
          "key": "Transaction/default/GrossConsideration",
          "value": {
            "metricValue": {
              "value": 100452.06
            }
          }
        },
        "Transaction/default/BondInterest": {
          "key": "Transaction/default/BondInterest",
          "value": {
            "metricValue": {
              "value": 452.06
            }
          }
        },
        "Transaction/default/ResultantHolding": {
          "key": "Transaction/default/ResultantHolding",
          "value": {
            "metricValue": {
              "value": 100000
            }
          }
        }
      },
      "transactionStatus": "Active",
      "realisedGainLoss": [],
      "sourceType": "InputTransaction",
      "resolvedTransactionTypeDetails": {
        "scope": "default",
        "source": "default",
        "type": "Buy"
      }
}
JSON