For each holding in a portfolio, LUSID calculates a running total of:
Local cost (in your choice of transaction or settlement currency)
Portfolio cost (using exchange rates where necessary to maintain the cost basis of the portfolio).
Depending upon the transaction type, every transaction that contributes towards a particular holding can impact this calculation of cost:
For a transaction that increases a position, LUSID increases the cost by the total consideration (converted appropriately).
For a transaction that decreases a position, LUSID reduces the cost proportionally to the cost of the holding. The difference between the cost reduction and the total consideration is the realised gain/loss. Note the precise impact is determined by the tax lot accounting method.
Note: The ‘total consideration’ of a transaction is a subjective concept in LUSID. You can choose whether to capitalise fees or not, include or exclude bond accrued interest, and so on.
A transaction type can have multiple movements, so a single transaction may impact multiple holdings. For example, a purchase of BP shares settling in GBP using the built-in Buy
transaction type impacts both a BP security holding and a GBP currency holding.
Understanding the implications of transaction currencies
A transaction has a transaction currency and a settlement currency, and belongs in a portfolio which itself has a base currency. These can all be the same, or different. More information.
When you book a transaction you must specify a settlement currency and amount using the mandatory totalConsideration
object:
The
totalConsideration.currency
field records the settlement currency ISO 4217 code, for exampleGBP
. LUSID creates one holding per instrument per settlement currency, and by default all transactions in that instrument in that currency contribute to the holding (though you can subdivide a holding using sub-holding keys).The
totalConsideration.amount
field records your definition of the trade value in the settlement currency, for example2000
. It can be negative, but typically it is positive. Either way, the impact on holding cost is determined by the direction of movement(s) responsible for generating that holding.
By default, LUSID assumes the transaction currency is the same as the settlement currency. However, if this is not the case, you should specify:
The
transactionCurrency
field to explicitly declare the transaction currency code, for exampleEUR
.The
exchangeRate
field to specify an exchange rate from transaction to settlement currency, for example0.85
. Note this field defaults to1
if omitted.
A portfolio’s base currency is specified when you create that portfolio, and once transactions are booked it cannot change. If the portfolio and transaction currencies are different, you should add the Transaction/default/TradeToPortfolioRate
system property to a transaction to specify an exchange rate from transaction to portfolio currency.
Configuring the currency in which local holding cost is calculated
You can choose whether LUSID calculates local holding cost in transaction currency or settlement currency.
This is controlled by the side component of all movements responsible for generating that holding. For example:
The built-in
Side1
designed for security (non-currency) holdings calculates local cost in transaction currency. This means the total consideration is automatically converted to transaction currency using the exchange rate provided (where different), and bond interest is excluded (where applicable).The built-in
Side2
designed for currency holdings calculates local cost in settlement currency.
To calculate cost for security holdings in settlement currency instead, replace Side1
with the following custom side:
{
"security": "Txn:LusidInstrumentId",
"currency": "Txn:SettlementCurrency",
"rate": "SettledToPortfolioRate",
"units": "Txn:Units",
"amount": "Txn:TotalConsideration"
}
Example 1: Calculating local holding cost
Note: This example assumes LUSID is configured to calculate local holding cost in transaction currency using
Side1
.
For each transaction, LUSID converts settlement currency to transaction currency as follows:
(totalConsideration.amount - Txn:BondInterest) / exchangeRate
Consider the following example of three consecutive transactions in a single Equity
instrument (so no bond interest) where:
The settlement currency is GBP
The transaction currency is also GBP, and so the exchange rate between them is 1:
Transaction fields | Holding fields | |||||
---|---|---|---|---|---|---|
|
|
|
|
|
|
|
Txn01 | Buy | 2000 | GBP | 1 | 2000 | GBP |
Txn02 | Buy | 5000 | GBP | 1 | 7000 | GBP |
Txn03 | Sell | 3000 | GBP | 1 | 4000 | GBP |
Consider the same three transactions where:
The settlement currency is GBP
The transaction currency is EUR and the EUR/GBP rate is 0.85:
Transaction fields | Holding fields | |||||
---|---|---|---|---|---|---|
|
|
|
|
|
|
|
Txn01 | Buy | 2000 | GBP | 0.85 | 2352.94 | EUR |
Txn02 | Buy | 5000 | GBP | 0.85 | 8235.29 | EUR |
Txn03 | Sell | 3000 | GBP | 0.85 | 4705.88 | EUR |
Example 2: Calculating portfolio holding cost
For each transaction, LUSID converts settlement currency to transaction currency and then to portfolio currency as follows:
((totalConsideration.amount - Txn:BondInterest) / exchangeRate) * transactionToPortfolioRate
Consider the following example of three consecutive transactions in a single Equity
instrument (so no bond interest) where:
The settlement currency is GBP
The transaction currency is GBP, and so the exchange rate between them is 1
The portfolio currency is USD, and the GBP/USD rate is 1.25:
Transaction fields | Holding fields | ||||||
---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
Txn01 | Buy | 2000 | GBP | 1 | 1.25 | 2500 | USD |
Txn02 | Buy | 5000 | GBP | 1 | 1.25 | 8750 | USD |
Txn03 | Sell | 3000 | GBP | 1 | 1.25 | 5000 | USD |
Consider the same three transactions where:
The settlement currency is GBP
The transaction currency is EUR and the EUR/GBP rate is 0.85
The portfolio currency is USD and the EUR/USD rate is 1.05:
Transaction fields | Holding fields | ||||||
---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
Txn01 | Buy | 2000 | GBP | 0.85 | 1.05 | 2470.59 | USD |
Txn02 | Buy | 5000 | GBP | 0.85 | 1.05 | 8647.06 | USD |
Txn03 | Sell | 3000 | GBP | 0.85 | 1.05 | 4941.18 | USD |