Module Daml.Finance.Claims.Util.Builders

This module includes utility functions used to build contingent claim trees that represent specific payoffs. A Schedule is usually used as an input to these utility functions. Given that schedules are defined in terms of dates, a claim where the time parameter is Date is returned. These are then mapped to claims where the time parameter is Time using a (user-provided) conversion function.

Functions

prepareAndTagClaims

: (Date -> Time) -> [Claim Date Decimal Deliverable Observable] -> Text -> TaggedClaim

Convert the claims to UTCTime and tag them.

createFixRatePaymentClaimsList
: Schedule -> PeriodicSchedule -> Bool -> Decimal -> Bool -> DayCountConventionEnum -> Decimal -> Deliverable -> [Claim Date Decimal Deliverable Observable]
createFixRatePaymentClaims

: (Date -> Time) -> Schedule -> PeriodicSchedule -> Bool -> Decimal -> Bool -> DayCountConventionEnum -> Decimal -> Deliverable -> TaggedClaim

Calculate a fix rate amount for each payment date and create claims.

createConditionalCreditFixRatePaymentClaims

: (Date -> Time) -> Schedule -> PeriodicSchedule -> Bool -> Decimal -> Bool -> DayCountConventionEnum -> Decimal -> Deliverable -> Observable -> TaggedClaim

Calculate a fix rate amount (if a credit event has not yet happened) for each payment date and create claims.

createCreditEventPaymentClaims

: (Date -> Time) -> Bool -> Decimal -> Deliverable -> Observable -> Observable -> PeriodicSchedule -> TaggedClaim

Calculate a (1-recoveryRate) payment if a credit event just happened and create claims.

createFloatingRatePaymentClaims

: (Date -> Time) -> Schedule -> PeriodicSchedule -> Bool -> Decimal -> Bool -> DayCountConventionEnum -> Decimal -> Deliverable -> Observable -> TaggedClaim

Calculate a floating rate amount for each payment date and create claims. The floating rate is always observed on the first day of each payment period and used for the corresponding payment on the last day of that payment period. This means that the calculation agent needs to provide such an Observable, irrespective of the kind of reference rate used (e.g. a forward looking LIBOR or a backward looking SOFR-COMPOUND).

createAssetPerformancePaymentClaims

: (Date -> Time) -> Schedule -> PeriodicSchedule -> Bool -> Bool -> DayCountConventionEnum -> Decimal -> Deliverable -> Observable -> TaggedClaim

Calculate the asset performance for each payment date and create claims. The performance is calculated using the reference asset from the start date to the end date of each payment period. The reference asset Observable needs to contain the appropriate type of fixings:

  • unadjusted fixings in case of a price return asset swap
  • adjusted fixings in case of a total return asset swap
createFxAdjustedPrincipalClaim

: (Date -> Time) -> Bool -> Decimal -> Decimal -> Deliverable -> Date -> TaggedClaim

Create an FX adjusted principal claim. This can be used for both FX swaps (using the appropriate FX rate) and single currency bonds (setting the FX rate to 1.0).

scaleByAssetPerformance

: Date -> Date -> O -> C -> C

Scale a claim by an asset’s performance. Specifically, this multiplies the input claim by the quantity S(endDate) / S(startDate) - 1.0.

createOptionsClaim

: (Date -> Time) -> Bool -> Decimal -> Observable -> Deliverable -> Date -> Bool -> TaggedClaim

Create the claim for a cash settled, automatically exercised option.