Views:

LUSID calculates profit and loss (P&L) as the difference between present value (PV) and cost at the start and again at the end of a window.

The end date of the window is always the effective at datetime of a request to perform a valuation. The start date of the window is configurable, and can either be the beginning of the current day, week, month, quarter or year, or an arbitrary point in time.

You should specify dedicated ProfitAndLoss metrics to report P&L. These replace Valuation/PnL/* metrics; contact us if you need a license to use them.

To list all ProfitAndLoss metrics, call the GetQueryableKeys API with a filter of domain eq 'ProfitAndLoss', for example:

curl -X GET "https://<your-domain>.lusid.com/api/api/results/queryable/keys?filter=domain%20eq%20%27ProfitAndLoss%27'"
  -H "Authorization: Bearer <your-API-access-token>"

ProfitAndLoss metrics break down total P&L into three categories, available in either transaction or portfolio currency:

  • Market P&L generated by market price movements, and broken down further into realised (from sell transactions) and unrealised (open positions).
  • FX P&L generated by exchange rate fluctuations, and broken down further into realised and unrealised.
  • Other P&L generated by interest, dividends, fees, commissions and so on. Note these metrics report carry activity categorised by transaction types with movements of type Carry. If you have not used these kinds of transaction types, these metrics are not populated (report zero).

For each ProfitAndLoss metric you must specify the Window option to set the start of the window, for example:

"metrics": [
  {"key": "ProfitAndLoss/Total", "op": "Value", "options": {"Window": "Daily"}},
]

Note: For more information on available op operations, see this article.

Window optionReturns...
DailyP&L since the start of the day (00:00:00001)
WTDP&L since the start of the week (Monday)
MTDP&L since the start of the month
QTDP&L since the start of the quarter
YTDP&L since the start of the year

By default, the timezone is UTC. To set a different timezone, append the TimeZone option with an IANA timezone country code, for example:

{"key": "ProfitAndLoss/Total", "op": "Value", "options": {"Window": "Daily", "TimeZone": "NZ"}}

To specify an arbitrary point in time, append the StartDateOverrideUTC option. Note this is UTC only (any TimeZone option is ignored), and you must still specify a Window option, for example:

{"key": "ProfitAndLoss/Total", "op": "Value", "options": {"Window": "Daily", "StartDateOverrideUTC": "2023-01-01"}}

By default, each metric reports an absolute amount. You can change this to a percentage of the PV at the start of the window by appending the Type option, for example:

{"key": "ProfitAndLoss/Total", "op": "Value", "options": {"Window": "Daily", "Type": "Percentage"}}

For example, if the starting PV of your holding in a particular instrument is $500 and the total P&L at the end is $100, then specifying the ProfitAndLoss/Total metric as:

  • An absolute amount (the default) reports $100.
  • A percentage reports 20%.