There are two ways that tax lot accounting can be performed in LUSID:
If you have a source system which provides specific tax lot ("versus purchase") details on all transactions then you can setup the Portfolio's sub-holding keys to segregate the Instrument-level holdings into separate tax lots
If your source system doesn't always provide tax lot information and you want LUSID to calculate tax lots based on a standard algorithm, you can instead configure this as part of the Portfolio setup process.
1. Using SubholdingKeys to segregate holdings into tax lots
Loading data into LUSID
Define a custom property in the
Transaction
domain to store the tax lot identifierCreate a transaction portfolio with the property as the sub-kolding key
Upsert transactions to the portfolio including a value for the property to indicate which taxlot to book each Transaction against
Retrieving data from LUSID
Using this configuration, the holdings and aggregation APIs will return tax lots without any further parameters.
2. Having LUSID determine tax lots automatically
Loading data into LUSID
You can set the accounting method to either FirstInFirstOut
, LastInFirstOut
, HighestCostFirst
or LowestCostFirst
. More information on accounting methods.
You can set this for one of the following entities, or create a waterfall of logic by setting it for all three:
On a transaction portfolio, using the
accountingMethod
field. The accounting method applies to every transaction in the portfolio.On a transaction type, using the
TransactionConfiguration/default/TaxLotSelectionMethod
system property. The accounting method applies to every transaction of that type in any portfolio, overriding the setting for a particular portfolio.On an individual transaction, using the
Transaction/default/TaxLotSelectionMethod
system property. The accounting method applies just to that transaction, overriding a setting for the transaction type and/or the portfolio.
Retrieving data from LUSID
The GetHoldings API has a parameter
byTaxlots
which indicates whether taxlot level information is requiredThe aggregation API will return taxlot level information if no specific grouping parameters are specified.