---
title: "How does LUSID calculate holding cost?"
slug: "how-is-cost-calculated-in-lusid"
updated: 2025-07-09T08:27:03Z
published: 2025-07-09T08:27:03Z
canonical: "support.lusid.com/how-is-cost-calculated-in-lusid"
---

> ## 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 does LUSID calculate holding cost?

For each holding in a portfolio, LUSID calculates a running total of:

- Local cost, in your choice of transaction or settlement currency.
- Portfolio (or base) cost, using exchange rates where necessary to maintain the cost basis of the portfolio.

Depending upon the [transaction type](/v1/docs/what-is-a-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](/v1/docs/how-does-lusid-calculate-realised-gainloss). Note the precise impact is determined by the [tax lot accounting method](/v1/docs/what-are-the-supported-tax-lot-accounting-methods-in-lusid).

> **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](/v1/docs/what-is-a-movement), 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 be all the same, or different. [More information](/v1/docs/transactions-and-exchange-rates).

When you [book a transaction](/v1/docs/how-do-i-create-or-update-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 example `GBP`. 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](/v1/docs/what-is-a-sub-holding-key-shk)).
- The `totalConsideration.amount` field records your definition of the trade value in the settlement currency, for example `2000`. 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 example `EUR`.
- The `exchangeRate` field to specify an exchange rate from transaction to settlement currency, for example `0.85`. Note this field defaults to `1` if omitted.

A portfolio’s base currency is specified when you [create that portfolio](/v1/docs/how-do-i-create-a-transaction-portfolio), and once transactions are booked cannot be changed. 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 cost is calculated

You can choose whether LUSID calculates local cost in transaction currency or settlement currency.

This is controlled by the [side](/v1/docs/what-is-a-side) component of all movements responsible for generating that holding. For example:

- The [built-in](/v1/docs/what-built-in-transaction-types-and-sides-are-provided-with-lusid#sides) `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](/v1/docs/how-do-i-create-a-side):

```json
{ 
  "security": "Txn:LusidInstrumentId",
  "currency": "Txn:SettlementCurrency",
  "rate": "SettledToPortfolioRate",
  "units": "Txn:Units",
  "amount": "Txn:TotalConsideration"
}
```

## Example 1: Calculating local cost

> **Note:** This example assumes LUSID is configured to calculate local 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 |
| --- | --- |
| `transactionId` | `type` | `totalConsideration.amount` | `totalConsideration.currency` | `exchangeRate` | `cost.amount` | `cost.currency` |
| 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 |
| --- | --- |
| `transactionId` | `type` | `totalConsideration.amount` | `totalConsideration.currency` | `exchangeRate` | `cost.amount` | `cost.currency` |
| 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 (base) 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 |
| --- | --- |
| `transactionId` | `type` | `totalConsideration.amount` | `totalConsideration.currency` | `exchangeRate` | `transactionToPortfolioRate` | `costPortfolioCcy.amount` | `costPortfolioCcy.currency` |
| 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 |
| --- | --- |
| `transactionId` | `type` | `totalConsideration.amount` | `totalConsideration.currency` | `exchangeRate` | `transactionToPortfolioRate` | `costPortfolioCcy.amount` | `costPortfolioCcy.currency` |
| 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 |

## Auditing the cost impact of transactions

You can examine the impact on holding cost (both local and base) of transactions by examining their [output transactions](/v1/docs/input-and-output-transactions).

Consider the same three consecutive transactions in [Example 2](/v1/docs/how-is-cost-calculated-in-lusid#example-2-calculating-portfolio-base-cost) above, 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

The running total of local and base holding cost is therefore as follows:

| **Transaction fields** | **Holdings fields** |
| --- | --- |
| `transactionId` | `type` | `totalConsideration.amount` | `totalConsideration.currency` | `cost.amount` | `cost.currency` | `costPortfolioCcy.amount` | `costPortfolioCcy.currency` |
| Txn01 | Buy | 2000 | GBP | 2352.94 | EUR | 2470.59 | USD |
| Txn02 | Buy | 5000 | GBP | 8235.29 | EUR | 8647.06 | USD |
| Txn03 | Sell | 3000 | GBP | 4705.88 | EUR | 4941.18 | USD |

To audit the cost impact in the LUSID web app, navigate to the **Portfolio Management > Transactions** screen in **Output** mode and examine the **Cost Impact (Local)** and **Cost Impact (Base)** columns:

![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image(932).png)

For example, for `Txn02` we can see that:

- The impact on local cost (EUR) is `8235.29 - 2352.94 = 5882.35`
- The impact on base cost (USD) is `8647.06 - 2470.59 = 6176.47`

For the LUSID API, call the [BuildTransactions](https://www.lusid.com/docs/api/lusid/endpoints/transaction-portfolios/BuildTransactions/) API with `includeEconomics=true` and examine the `economics` object in the response, for example for `Txn02`:

```json
"economics": [
  {
    "lusidInstrumentId": "LUID_00003EJ1",
    "buckets": [
      {
        "movementName": "Side1",
        "holdingType": "P",
        "economicBucket": "NA_Cost",
        "holdingSign": "Long",
        "local": {
          "amount": 5882.35,
          "currency": "EUR"
        },
        "base": {
          "amount": 6176.47,
          "currency": "USD"
        },
        "units": 500,
      }
    ]
  },
  ...
```
