- Book a transaction in a portfolio to record a purchase of a quantity of that equity, and establish a holding (position)
- Value your position at any time
- Assess PV and P&L on a regular basis
- Book further transactions to change or close your position
- Monitor lifecycle events such as cashflows from dividend payments.
Note: If you are the LUSID domain owner, you are automatically assigned the built-in lusid-administrator role, which has all the permissions necessary to perform the operations in this article.
Note there is an accompanying Jupyter Notebook that demonstrates many of the operations and concepts in this article.
LUSID's instrument model is designed with reference to ISDA CDM and FpML, and equities constitute an integral part of this instrument model.
To create an instrument modelling an equity, call the LUSID UpsertInstruments API and specify a definition with an instrumentType of Equity and a domestic currency. For more information, examine the API documentation and choose Equity from the dropdown box:
Providing the request is valid, the response contains an extra identifier, in this case LUID_00003D5C. This is because LUSID automatically generates a LUSID instrument ID (or LUID) for every instrument that is guaranteed to be unique and never change. You can use this LUID to reference the instrument in subsequent API calls:
Once the instrument is mastered, you can call the LUSID UpsertTransactions API to purchase a quantity of the equity in a particular portfolio:
Note this transaction uses the built-in Buy transaction type, which is tailor-made to represent a stock movement into the portfolio and a cash movement out, but you could define your own custom transaction type to represent equity purchases if you wish.
You can confirm your position at any time by calling the LUSID GetHoldings API with the appropriate LUID:
To value your position, first load suitable market data into LUSID and then create a valuation recipe. For demonstrations of these operations, see sections 4 and 6 respectively of the accompanying Jupyter Notebook.
In your recipe, there's no need to specify a PricingContext object with a pricing model to use. This is because, by default, a LUSID recipe automatically performs a simple calculation of market price * quantity held.
You can value your position at any time to calculate P&L from PV and use this information to decide the right time to change or close your position.
In section 6 of the accompanying Jupyter Notebook, you can see the P&L changing between days 1 and 2 as the market price of the equity fluctuates.
You can call the LUSID UpsertTransactions API again to sell a quantity of the equity at any time to reduce your position. The following example shows the use of the built-in Sell transaction type to represent a stock movement out of the portfolio and a cash movement in:
The purchase of an equity is not a contract that expires, so an equity instrument does not have a lifecycle in the normal sense.
Typically, you close your position at a time when P&L is favourable to you, though real-world change of control events such as mergers or insolvencies may impact the outcome.
LUSID does have tools that enable you to monitor portfolio cashflows that derive from a dividend payment or some other corporate action affecting an equity instrument. You can:
- Use the Cash Ladder dashboard in the LUSID web app.
- Call the LUSID GetPortfolioCashLadder API directly.
- Schedule a job to create a regular report.
For a demonstration, see section 6, Cash Ladder in the accompanying Jupyter Notebook. The corporate action itself, a dividend payment, is defined and booked in section 5.