Handling instrument events for repurchase agreements

Prev Next

You can model a repurchase agreement (“repo”) as a buyer or as a seller using the FlexibleRepo instrument type in LUSID. See how to do this.

LUSID provides the following instrument lifecycle events for a FlexibleRepo, which you can handle or trigger as required:

  • FlexibleRepoCashFlowEvent. This event is automatically emitted on the start date and again on the maturity date specified in the instrument definition. More information.

  • FlexibleRepoCollateralEvent. This event is automatically emitted on the start date and again on the maturity date. More information.

  • FlexibleRepoInterestPaymentEvent. This event is automatically emitted for an OpenRepo at the end of each interest payment window. More information.

  • FlexibleRepoPartialClosureEvent. This event is not automatically emitted by LUSID, but can be manually loaded to trigger a partial closure. More information.

  • FlexibleRepoFullClosureEvent. This event is not automatically emitted by LUSID, but can be manually loaded to close an OpenRepo. More information.

  • MaturityEvent. This event is automatically emitted on the maturity date. More information.

Mastering instruments and establishing positions

Imagine we have two portfolios in LUSID with holdings in the following instruments:

  • Each has a FlexibleRepo instrument of type TermRepo that is identical except one has a repoType of Buyer and the other Seller.

  • Each has the same fixed-rate Bond collateral instrument with monthly coupons mastered separately and referenced as a MasteredInstrument.

See how to set this scenario up. In summary, each portfolio contains:

Instrument type

Positions

FlexibleRepo

Units: 1

Transaction date: 1 January 2025

Start date: 2 January 2025

Maturity date: 31 March 2025

Length of contract: 88 days

Purchase price: £1,000,000

Repurchase price: £1,012,054.79

Bond collateral coupons: Seller keeps

Bond

Units: 3

Transaction date: 1 January 2025

Coupon date: 28th of each month

Coupon amount: Approximately £20.80 per unit held

Since the date of a transaction to establish a position in a FlexibleRepo must be before the start date of the instrument, our holdings on 1 January 2025 are identical (click to enlarge):

Buyer portfolio

Seller portfolio

Handling cash transfer on start and maturity dates

LUSID emits FlexibleRepoCashFlowEvent on the:

  • Start date specified in the instrument definition to transfer the purchase price from the buyer to the seller.

  • Maturity date to transfer the repurchase price from the seller to the buyer.

For more information on this event, start by calling the GetTransactionTemplate API to examine the transaction template.

To handle this event, you must create a FlexibleRepoCashTransfer transaction type in the default scope and default source. See our recommendation.

Start date

With the FlexibleRepoCashTransfer transaction type in place, we can examine holdings for both portfolios on 2 January 2025 to see that LUSID has transferred £1,000,000 from the buyer to the seller:

Buyer portfolio

Seller portfolio

We can examine the output transaction automatically generated by FlexibleRepoCashFlowEvent in each portfolio to implement this transfer:

Buyer portfolio

Seller portfolio

Maturity date

On 31 March 2025 we examine holdings again to see that LUSID has transferred £1,012,054.79 from the seller to the buyer:

Buyer portfolio

Seller portfolio

We can examine the output transaction automatically generated by FlexibleRepoCashFlowEvent in each portfolio to implement this transfer:

Buyer portfolio

Seller portfolio

Handling collateral transfer on start and maturity dates

LUSID emits FlexibleRepoCollateralEvent on the:

  • Start date specified in the instrument definition to transfer collateral unit(s) from the buyer to the seller.

  • Maturity date to transfer collateral unit(s) from the seller to the buyer.

For more information on this event, start by calling the GetTransactionTemplate API to examine the transaction template.

To handle this event, you must create a FlexibleRepoCollateralTransfer transaction type in the default scope and default source. See our recommendation.

Note: If you do not want to transfer collateral units between buyer and seller you can simply ignore this event by not creating the FlexibleRepoCollateralTransfer transaction type.

Start date

With the FlexibleRepoCollateralTransfer transaction type in place, we can examine holdings for both portfolios on 2 January 2025 to see that LUSID has transferred one Bond collateral unit from the seller to the buyer:

Buyer portfolio

Seller portfolio

We can examine the output transaction automatically generated by FlexibleRepoCollateralEvent in each portfolio to implement this transfer:

Buyer portfolio

Seller portfolio

Maturity date

On 31 March 2025 we examine holdings again to see that LUSID has transferred one Bond collateral unit from the buyer to the seller:

Buyer portfolio

Seller portfolio

We can examine the output transaction automatically generated by FlexibleRepoCollateralEvent in each portfolio to implement this transfer:

Buyer portfolio

Seller portfolio

Understanding cashflow ownership for collateral transferred

In our example, coupons for the Bond collateral during the lifetime of the FlexibleRepo are due on the following dates: 28 January, 28 February, 28 March.

Providing LUSID is set up to handle BondCouponEvent, a coupon for approximately £20.80 per bond collateral unit held is automatically generated, so for example on 28 January:

  • In the buyer portfolio with four units held, LUSID generates a coupon for £83.33.

  • In the seller portfolio with two units held, LUSID generates a coupon for £41.67.

However, since the FlexibleRepo instrument is set up for the seller to keep bond coupon payments, LUSID automatically handles refunding the seller the coupon for the transferred unit.

If we examine holdings on 28 January we see equal bond coupon cash of £62.50, despite the Bond collateral units held being different:

Buyer portfolio

Seller portfolio

We can examine the output transaction generated by FlexibleRepoCashFlowEvent in each portfolio to implement this refund (note the Manufactured tag in the transaction ID):

Buyer portfolio

Seller portfolio

Handling intermediate interest payments for an open repo

If the repoType is OpenRepo, LUSID emits FlexibleRepoInterestPaymentEvent at the end of each interest payment window to transfer accrued interest from the seller to the buyer. For more information on this event, start by calling the GetTransactionTemplate API to examine the transaction template.

To handle this event, you must create a FlexibleRepoInterestPayment transaction type in the default scope and default source. See our recommendation.

For example, if the startDate is 2 January 2025 and openRepoRollingPeriod is set to 1W (signalling weekly interest payment windows), then LUSID emits FlexibleRepoInterestPaymentEvent on 9 January, 16 January, 23 January and so on until either maturityDate or the repo is fully closed.

If we examine holdings on 9 January we see an accrued interest payment of £958.90 has been credited to the buyer’s cash balance, and debited from the seller’s:

Buyer portfolio

Seller portfolio

We can examine the output transaction generated by FlexibleRepoInterestPaymentEvent in each portfolio to implement this transfer:

Buyer portfolio

Seller portfolio

Partially closing a repo

More information coming soon

Fully closing an open repo

If the repoType is OpenRepo, you can close a FlexibleRepo on a particular date by manually loading a FlexibleRepoFullClosureEvent into LUSID. To do this:

  1. Create a corporate action source and subscribe all portfolios with a holding in the FlexibleRepo to that source. See how to do this.

  2. Load the FlexibleRepoFullClosureEvent into the corporate action source. See this article for general information, and also the example below.

For example, to fully close on 25 January 2025 we could call the UpsertInstrumentEvents API as follows:

curl -X POST 'https://<your-domain>.lusid.com/api/api/corporateactionsources/Example-CAS-scope/Example-CAS-code/instrumentevents'
 -H 'Content-Type: application/json-patch+json'
 -H 'Authorization: Bearer <your-API-access-token>'
 -d '[
  {
    "instrumentEventId": "CloseFlexRepo-25-01-2025",
    "instrumentIdentifiers": {"Instrument/default/ClientInternal": "Buyer-OpenFlexRepo"},
    "description": "Close open FlexibleRepo on 25 January 2025",
    "instrumentEvent": {
      "instrumentEventType": "FlexibleRepoFullClosureEvent",
      "entitlementDate": "2025-01-25T00:00:00.0000000+00:00",
      "settlementDate": "2025-01-25T00:00:00.0000000+00:00",
    }
  }
]'

Note that LUSID emits the following events on the closure date in order:

  1. FlexibleRepoCashFlowEvent

  2. FlexibleRepoCollateralEvent

  3. MaturityEvent

Handling repo maturity

LUSID emits MaturityEvent on the maturity date specified in the instrument definition. This is a generic event designed to reduce an instrument position in a portfolio down to zero, so it drops out of holding and valuation reports.

For more information on this event, start by calling the GetTransactionTemplate API to examine the transaction template.

Note: LUSID always emits FlexibleRepoCashFlowEvent and FlexibleRepoCollateralEvent before MaturityEvent.

To handle this event, you must create a Maturity transaction type in the default scope and default source. See our recommendation.

If we examine holdings on 31 March 2025 we see there is no longer a position in the FlexibleRepo instrument in either portfolio:

Buyer portfolio

Seller portfolio

We can examine the output transaction automatically generated by MaturityEvent in each portfolio to reduce the number of units held down to zero:

Buyer portfolio

Seller portfolio