How do I adjust or set holdings?

Prev Next

You can set or adjust holdings directly in a portfolio using the LUSID API or Luminesce. You cannot currently use the LUSID web app.

Methods

Call the:

  • BatchSetHoldings API to make the whole portfolio match the request. Holdings you leave out, including cash, go to zero.

  • BatchAdjustHoldings API to change only the holdings in the request.

Choose a successMode:

  • Atomic: If any holding fails validation, LUSID writes nothing. Use this for BatchSetHoldings, since in Partial mode a holding that fails validation is left out of the set, so LUSID reduces it to zero.

  • Partial (the default): LUSID writes the valid holdings and reports the rest as failed.

Note: LUSID also has non-batch SetHoldings and AdjustHoldings APIs, which take a single effective date for the whole request. We recommend the batch APIs.

Both batch APIs accept multiple holdings, each with its own effectiveAt and keyed by an ID of your choice, which LUSID uses to report failures. For example, to set a portfolio to a total of two holdings (5,000 BP shares in a growth strategy and £25,000 of cash) on 31 October 2026:

curl -X POST 'https://<your-domain>.lusid.com/api/api/transactionportfolios/MyScope/MyCode/holdings/$batchSet?successMode=Atomic'
  -H 'Content-Type: application/json-patch+json'
  -H 'Authorization: Bearer <your-API-access-token>'
  -d '{
  "bp": {
    "effectiveAt": "2026-10-31T00:00:00Z",
    "instrumentIdentifiers": {"Instrument/default/Figi": "BBG000C05BD1"},
    "subHoldingKeys": {
      "Transaction/MySHKs/Strategy": {
        "key": "Transaction/MySHKs/Strategy",
        "value": {"labelValue": "Growth"}
      }
    },
    "properties": {
      "Holding/MyProperties/Analyst": {
        "key": "Holding/MyProperties/Analyst",
        "value": {"labelValue": "J Smith"}
      }
    },
    "taxLots": [
      {
        "units": 5000,
        "cost": {"amount": 50000, "currency": "GBP"},
        "portfolioCost": 50000,
        "price": 10,
        "purchaseDate": "2025-03-14T00:00:00Z",
        "settlementDate": "2025-03-18T00:00:00Z"
      }
    ]
  },
  "gbp-cash": {
    "effectiveAt": "2026-10-31T00:00:00Z",
    "instrumentIdentifiers": {"Instrument/default/LusidInstrumentId": "CCY_GBP"},
    "taxLots": [{"units": 25000, "cost": {"amount": 25000, "currency": "GBP"}}]
  }
}'

Note the following:

  • The Transaction/MySHKs/Strategy sub-holding key puts the BP shares in a Growth sub-holding. The key must be registered with the portfolio.

  • The Holding/MyProperties/Analyst property records the analyst responsible on the BP holding.

  • The purchaseDate and settlementDate record that the manager originally bought the lot in March 2025.

  • The cash holding is identified by the LUID of the currency, CCY_GBP.

Write a Luminesce SQL query using the Lusid.Portfolio.Holding.Writer provider and execute it from a tool such as the LUSID web app. The WriteAction column determines the operation:

WriteAction

Effect

Adjust (default)

Adjust holdings

Set

Set holdings

Cancel

Cancel every set and adjust at EffectiveAt

CancelAdjustment

Cancel the adjustment to one holding (adjusts only; see below)

Each row is one tax lot, and rows with the same instrument and sub-holding keys form one holding. LUSID groups rows by portfolio and EffectiveAt, and writes each group all-or-nothing. For example:

@holdings = values
('LUID_00003HDS', 5000, 50000, 10),
('CCY_GBP', 25000, 25000, 1);

@table_of_data = select 'MyScope' as PortfolioScope, 'MyCode' as PortfolioCode, #2026-11-07# as EffectiveAt,
column1 as LusidInstrumentId, column2 as Units, column3 as CostAmount, column4 as CostPrice,
'GBP' as CostCurrency, 'Set' as WriteAction
from @holdings;

select * from Lusid.Portfolio.Holding.Writer where ToWrite = @table_of_data;

Request fields

This section supplements the API documentation.

You must specify at least one tax lot. Together, the tax lots make up the holding. To set a holding lot by lot, send multiple. LUSID matches them to the holding's existing lots on purchaseDate and price.

To remove a holding, send one tax lot with units of 0.

Mandatory fields

Explanation

effectiveAt

The date or cut label on which the portfolio should match this holding. The output transactions that LUSID generates have a trade date and settlement date equal to effectiveAt, so they settle immediately. Find out how LUSID orders events on the same date.

instrumentIdentifiers

At least one unique instrument identifier, as a three-stage key and a value, for example Instrument/default/Figi and BBG000C05BD1. For cash, specify either Instrument/default/LusidInstrumentId and eg. CCY_GBP or Instrument/default/Currency and GBP.

If LUSID can't resolve an instrument, it still accepts the holding and returns an InstrumentsNotFound warning. It resolves the holding when you master the instrument.

taxLots.units

The number of units in the lot. For cash, this is the amount.

Selected optional fields

Explanation

currency

The currency of the holding. LUSID keeps one holding per instrument per currency. If you omit this, LUSID uses cost.currency. If you specify both, they must match.

subHoldingKeys

One or more sub-holding keys (SHKs) registered with the portfolio. These must be properties from the Transaction domain that are registered with the portfolio; LUSID adds them to generated output transactions.

If you omit this, LUSID targets the holding with no sub-holding key values. A set reduces any sub-holding you don't send to zero.

custodianAccountId

The scope and code of a custodian account, to target the holding in that account.

properties

Properties from the Holding domain to extend the data model. LUSID changes only the properties you send. To delete a property, send it with a null value.

taxLots.cost.amount,

taxLots.cost.currency

The total cost of the lot, in the holding currency. If you omit cost, LUSID keeps the holding's current average cost per unit. For a new holding, the cost is zero.

taxLots.portfolioCost

The total cost of the lot in the portfolio's base currency. Specify this if the holding currency is different from the base currency. If you omit this, LUSID derives it from cost, using the holding's current ratio of portfolio cost to cost.

taxLots.price

The price per unit at which the lot was bought. Together with purchaseDate, it identifies the lot.

taxLots.purchaseDate,

taxLots.settlementDate

When the lot was originally bought and settled. These dates are often well before effectiveAt; for example, when you take on a fund, they're the dates on which the previous manager bought each lot. If you leave them out, they default to effectiveAt.

They don't change when the adjustment takes effect or settles. LUSID keeps them on the tax lot. Where they differ from effectiveAt, it records them on generated output transactions using the Transaction/default/OriginalTradeDate and Transaction/default/OriginalSettlementDate system properties.

taxLots.notionalCost, taxLots.variationMargin, taxLots.variationMarginPortfolioCcy, taxLots.amortisedCost, taxLots.currentFace, taxLots.chargeableGainsTakeOn

For instruments that need them: notional cost and variation margin for margined instruments such as futures; amortised cost and current face for bonds and asset-backed securities; and carried-forward chargeable-gains balances for UK life funds.

Correcting one position in a set

You don't need to resend a whole positions file to make a single correction (for example) to the number of units in a lot. Instead:

  1. Adjust holdings for just that instrument, with the correct units and cost.

  2. Use exactly the same effectiveAt as the original set.

LUSID replaces that one holding in the 31 October target and keeps the rest of the set. The date still behaves as a full set, so holdings you didn't send are still zero.

Note the following:

  • Order matters. LUSID applies writes at the same effectiveAt in the order you make them. If you set holdings at that date again, for example because the manager resends the file, the new set replaces your correction and you need to adjust again.

  • You can't edit the AdjustmentIncrease or AdjustmentDecrease output transactions that LUSID generates. Change the target instead.

  • If you'd rather book a transaction, book it for the difference, not the replacement amount. Give it a trade time later than the set's effectiveAt, because a transaction at exactly the same time is absorbed by the set. Find out more about ordering on the same date.

Viewing sets and adjusts

To see:

Cancelling a set or adjust

Call the:

  • CancelAdjustHoldings API to remove every set and adjust at an effectiveAt. The portfolio reverts to what its transactions produce.

  • CancelSingleAdjustHolding API to remove the adjustment to one holding. It works only where the date has adjusts alone; if the date has a set, LUSID ignores the request. To change one holding in a set, adjust it instead.