ContingentClaims.Core.Builders

Functions

unrollDates

: Int -> Int -> [Month] -> Int -> [Date]

Helper function to generate a series of fixing dates, e.g. for coupon payments in fixed. This assumes fixingMonths and fixingDates are ordered. The Daml Finance library(https://github.com/digital-asset/daml-finance) has more feature-complete date handling functions.

forward

: t -> Observation t x o -> Claim t x a o -> Claim t x a o

Forward agreement. Discounted by (potentially stochastic) interest rate r.

fra

: t -> t -> Observation t x o -> Observation t x o -> Claim t x a o -> Claim t x a o

Forward rate agreement.

zcb

: t -> x -> ccy -> Claim t x ccy o

Zero Coupon Bond.

floating

: Observation t x o -> Observation t x o -> ccy -> [t] -> Claim t x ccy o

A floating rate bond.

fixed

: x -> x -> ccy -> [t] -> Claim t x ccy o

A (fixed rate) coupon paying bond.

european

: t -> Claim t x a o -> Claim t x a o

European option on the input claim. At maturity, the holder must EXERCISE or EXPIRE the claim. e.g. call option on S&P 500:

european (date 2021 05 14) (observe "SPX" - pure 4200)
bermudan

: [t] -> Claim t x a o -> Claim t x a o

Bermudan option on the input claim. Given a pre-defined set of times {t_1, t_2, .., t_N}, it allows the holder to acquire the underlying claim on at most one of these times. At each election time before maturity, the holder must EXERCISE the option or POSTPONE. At maturity, the holder must EXERCISE or EXPIRE.

american

: t -> t -> Claim t x a o -> Claim t x a o

American option (knock-in). The lead parameter is the first possible acquisition date.

swap

: ([t] -> Claim t x a o) -> ([t] -> Claim t x a o) -> [t] -> Claim t x a o

Asset swap on specific fixing dates [t]. For example:

fixedUsdVsFloatingEur : [t] -> Serializable.Claim Text
fixedUsdVsFloatingEur =
  fixed 100.0 0.02 "USD" `swap` floating (observe "USDEUR" * pure 100.0) (observe "EUR1M") "EUR"