Finance - Maple Programming Help

Finance

 return the fair spread of interest rate swap

Parameters

 swap - swap data structure; interest rate swap discount - non-negative constant of a yield term structure; discount rate

Description

 • The FairSpread command returns the fair spread of the given interest rate swap.

Examples

 > $\mathrm{with}\left(\mathrm{Finance}\right):$
 > $\mathrm{SetEvaluationDate}\left("January 02, 2007"\right):$
 > $\mathrm{EvaluationDate}\left(\right)$
 ${"January 2, 2007"}$ (1)

Consider two payment schedules. The first one consists of payments of 5% of the nominal every month between January 3, 2008 and January 3, 2018. The second one consists of payments of 3% of the nominal every quarter between January 3, 2010 and January 3, 2015.

 > $\mathrm{Schedule1}≔\mathrm{Schedule}\left("January 03, 2008","January 03, 2018",\mathrm{Monthly}\right)$
 ${\mathrm{Schedule1}}{:=}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (2)
 > $\mathrm{Schedule2}≔\mathrm{Schedule}\left("January 03, 2010","January 03, 2015",\mathrm{Quarterly}\right)$
 ${\mathrm{Schedule2}}{:=}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (3)
 > $\mathrm{Rate1}≔0.05$
 ${\mathrm{Rate1}}{≔}{0.05}$ (4)
 > $\mathrm{Rate2}≔\mathrm{BenchmarkRate}\left(0.03\right)$
 ${\mathrm{Rate2}}{:=}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (5)

Consider two simple swaps that exchange the first set of payments with the second set.

 > $\mathrm{Swap1}≔\mathrm{InterestRateSwap}\left(1000,\mathrm{Rate1},\mathrm{Schedule1},\mathrm{Rate2},\mathrm{Schedule2},0.03\right)$
 ${\mathrm{Swap1}}{:=}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (6)
 > $\mathrm{Swap2}≔\mathrm{InterestRateSwap}\left(1000,\mathrm{Rate2},\mathrm{Schedule2},\mathrm{Rate1},\mathrm{Schedule1},0.03\right)$
 ${\mathrm{Swap2}}{:=}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (7)
 > $\mathrm{DiscountRate}≔0.05$
 ${\mathrm{DiscountRate}}{≔}{0.05}$ (8)
 > $\mathrm{NetPresentValue}\left(\mathrm{Swap1},\mathrm{DiscountRate}\right)$
 ${-146.0132438}$ (9)
 > $\mathrm{NetPresentValue}\left(\mathrm{Swap2},\mathrm{DiscountRate}\right)$
 ${146.0132438}$ (10)
 > $\mathrm{Spread1}≔\mathrm{FairSpread}\left(\mathrm{Swap1},\mathrm{DiscountRate}\right)$
 ${\mathrm{Spread1}}{≔}{0.06859218772}$ (11)
 > $\mathrm{Spread2}≔\mathrm{FairSpread}\left(\mathrm{Swap2},\mathrm{DiscountRate}\right)$
 ${\mathrm{Spread2}}{≔}{0.06859218772}$ (12)

Consider the same simple swaps that use the fair spread.

 > $\mathrm{Swap3}≔\mathrm{InterestRateSwap}\left(1000,\mathrm{Rate1},\mathrm{Schedule1},\mathrm{Rate2},\mathrm{Schedule2},\mathrm{Spread1}\right)$
 ${\mathrm{Swap3}}{:=}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (13)
 > $\mathrm{Swap4}≔\mathrm{InterestRateSwap}\left(1000,\mathrm{Rate1},\mathrm{Schedule1},\mathrm{Rate2},\mathrm{Schedule2},\mathrm{Spread2}\right)$
 ${\mathrm{Swap4}}{:=}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (14)
 > $\mathrm{NetPresentValue}\left(\mathrm{Swap3},\mathrm{DiscountRate}\right)$
 ${-8.455060652}{}{{10}}^{{-9}}$ (15)
 > $\mathrm{NetPresentValue}\left(\mathrm{Swap4},\mathrm{DiscountRate}\right)$
 ${-8.455060652}{}{{10}}^{{-9}}$ (16)

Compatibility

 • The Finance[FairSpread] command was introduced in Maple 15.