Hi, I’m strugling trying to understand callable bond example.
I don’t understand why called
and notCalled
claims have different directions (give vs no give). In the case the bearer is the investor I would say that the investor should receive principal in both cases (called or notCalled).
-- | Creates the claim for a callable bond and the corresponding elections
bootstrapBond : Date -> Date -> Decimal -> Decimal -> Deliverable -> (C, C, C)
bootstrapBond intermediateDate maturity couponAmount principal ccy =
let
coupon = scale (Const couponAmount) $ one ccy
called = give $ scale (Const principal) $ one ccy
notCalled = when (at maturity) $ scale (Const principal) $ one ccy
callableBond = when (at intermediateDate) $ and coupon $ give $ or called notCalled
in (mapClaimToUTCTime callableBond, mapClaimToUTCTime called, mapClaimToUTCTime notCalled)
I guess that I’m missing something, but for me the code bellow it would make more sense. However the test fails.
-- Removing `give` from `called` and `give` before the election (`callableBond`)
bootstrapBond : Date -> Date -> Decimal -> Decimal -> Deliverable -> (C, C, C)
bootstrapBond intermediateDate maturity couponAmount principal ccy =
let
coupon = scale (Const couponAmount) $ one ccy
called = scale (Const principal) $ one ccy
notCalled = when (at maturity) $ scale (Const principal) $ one ccy
callableBond = when (at intermediateDate) $ and coupon $ or called notCalled
in (mapClaimToUTCTime callableBond, mapClaimToUTCTime called, mapClaimToUTCTime notCalled)
I’d appreciate any help. Thank you!