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) -> [C] -> Text -> TaggedClaim

Convert the claims to UTCTime and tag them.

createFixRatePaymentClaimsList
: Schedule -> PeriodicSchedule -> Bool -> Decimal -> Bool -> DayCountConventionEnum -> Decimal -> Deliverable -> [C]
createFixRatePaymentClaims

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

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

createRatePaymentClaims

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

Calculate a floating rate amount for each payment date and create claims. This is a general function that supports both LIBOR and SOFR-COMPOUND reference rates. It also supports a fix rate spread. If no floating rate is provided, only the fix spread is used, i.e. fix rate claims are created.

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.

createAssetPerformancePaymentClaims

: (Date -> Time) -> Schedule -> PeriodicSchedule -> Bool -> Bool -> DayCountConventionEnum -> Decimal -> Deliverable -> [(Text, Decimal)] -> TaggedClaim

Calculate the asset performance for each payment date and create claims. The performance is calculated using the weighted performance of the basket underlyings from the start date to the end date of each payment period. The reference asset Observables need 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).

createVanillaOptionClaim

: (Date -> Time) -> Decimal -> Observable -> Deliverable -> Date -> Bool -> Optional Decimal -> Decimal -> C

Create the claim for a long vanilla option (cash-settled, automatically exercised).

createEuropeanCashClaim

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

Create the claim for a cash-settled, automatically exercised option (long or short).

createBarrierEuropeanCashClaim

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

Create the claim for a barrier option (automatically exercised, cash-settled).

createEuropeanPhysicalClaim

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

Create the claim for a physically settled European option.

createDividendOptionClaim

: (Date -> Time) -> Date -> InstrumentQuantity -> Optional InstrumentQuantity -> Optional InstrumentQuantity -> TaggedClaim

Create the claim for a physically settled Dividend option.