You can close or lock a period and specify that balances in particular accounts be transferred to other accounts.
This feature is designed to set P&L accounts to zero at year end so LUSID can calculate accurate year-to-date P&L figures for the next year.
To do this, you must:
- Add a cleardown module to your chart of accounts (CoA) with at least one cleardown rule specifying the account(s) to transfer from and to.
- Specify the code of the cleardown module in your ABOR configuration module.
- Close or lock a period with the
ApplyClearDown
closing option.
Example
Imagine we have a GBP-denominated transaction portfolio holding UK equities, and an ABOR set up for this portfolio with the following general ledger accounts in its CoA:
We can call the GetCleardownModule API to see that the CoA has a single cleardown module with a single cleardown rule transfering balances in revenue, expense and income-type accounts to the 5-YearEnd
account:
{ "cleardownModuleCode": "Cleardown", "chartOfAccountsId": { "scope": "Abor", "code": "Standard" }, "displayName": "CleardownModule", "rules": [ { "ruleId": "Rule001", "generalLedgerAccountCode": "5-YearEnd", "ruleFilter": "Account.Type in 'Revenue','Expense','Income'" } ], ... }
15 December 2023
Our first trade is a purchase of 100 BP shares @ £10 per share = £1,000, trading and settling on 15 December for simplicity. We can call the GetTrialBalance API from portfolio inception to 15 December to provide an accounting view of activity to date:
31 December 2023
There are no more transactions in December. When we call the GetTrialBalance
API from portfolio inception to the end of December we see an unrealised gain of £100 has been posted to the 4-PnL
account, reflecting a movement in the BP share price in our favor from £10 to £11 (highlighted in red below):
2 January 2024
At EOD on 2 January we call the ClosePeriod API to close the December 2023 period. Since the month of December incorporates year end, we apply the ApplyClearDown
closing option (highlighted in red below):
curl -X POST 'https://<your-domain>.lusid.com/api/api/abor/Abor/Standard/accountingdiary/$closeperiod'
-H 'Content-Type: application/json-patch+json'
-H 'Authorization: Bearer <your-API-access-token>'
-d '{
"effectiveAt": "2023-12-31T23:59:59Z",
"queryAsAt": "2024-01-02T17:00:00Z",
"closingOptions": ["ApplyClearDown"]
}'
3 January 2024
At SOD on 3 January we call the GetTrialBalance
API from 1 January to 3 January, using the unique code of the closed December 2023 period as the start date.
Note: It is not possible to call this API from portfolio inception on 1 December through to 3 January. You can use the unique code of a closed or locked period with cleardown applied as the start or end date of a trial balance, but you cannot query across a cleared down period boundary.
We can see that:
- The £100 balance in the
4-PnL
account from 31 December has been transferred to the5-YearEnd
account (highlighted in green below). - The
4-PnL
account has an opening balance on 1 January of zero, and a closing balance on 3 January of £50, reflecting a further movement in the BP share price in our favor from £11 to £11.50 (highlighted in red).
In other words, with cleardown applied the year-to-date P&L for 2024 is £50, not £150:
Note: LUSID does not currently generate journal entry lines for this transfer. This may change in future.
We can confirm that year-to-date P&L without cleardown applied would erroneously be £150 by calling the GetTrialBalance
API for the same period with the excludeCleardownModule
option set to True
in the API request. The 5-YearEnd
account, meanwhile, is empty and therefore unreported: