Finance - Maple Programming Help

Home : Support : Online Help : Mathematics : Finance : Financial Instruments : Finance/Swap

Finance

 Swap
 construct a swap instrument

 Calling Sequence Swap(firstleg, secondleg)

Parameters

 firstleg - list of cash flows; paying leg secondleg - list of cash flows; receiving leg

Description

 • The Swap command constructs an instrument that swaps one set of cash flows with another set.

Examples

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

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}}$ (1)
 > $\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}}$ (2)
 > $\mathrm{Rate1}≔0.05$
 ${\mathrm{Rate1}}{≔}{0.05}$ (3)
 > $\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}}$ (4)

Consider two simple swaps that exchange the first set of payments for 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}}$ (5)
 > $\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}}$ (6)
 > $\mathrm{NetPresentValue}\left(\mathrm{Swap1},0.05\right)$
 ${-146.0132438}$ (7)
 > $\mathrm{NetPresentValue}\left(\mathrm{Swap2},0.05\right)$
 ${146.0132438}$ (8)

You can implement the above instrument as an ordinary swap using explicit cash flows. Here is the set of cash flows for the paying leg of each swap.

 > $\mathrm{PayingLeg1}≔\mathrm{CashFlows}\left(\mathrm{Swap1},\mathrm{paying}\right)$
 ${\mathrm{PayingLeg1}}{≔}\left[{\mathrm{4.234972678 on \text{'}February 3, 2008\text{'}}}{,}{\mathrm{3.961748634 on \text{'}March 3, 2008\text{'}}}{,}{\mathrm{4.234972678 on \text{'}April 3, 2008\text{'}}}{,}{\mathrm{4.098360656 on \text{'}May 3, 2008\text{'}}}{,}{\mathrm{4.234972678 on \text{'}June 3, 2008\text{'}}}{,}{\mathrm{4.098360656 on \text{'}July 3, 2008\text{'}}}{,}{\mathrm{4.234972678 on \text{'}August 3, 2008\text{'}}}{,}{\mathrm{4.234972678 on \text{'}September 3, 2008\text{'}}}{,}{\mathrm{4.098360656 on \text{'}October 3, 2008\text{'}}}{,}{\mathrm{4.234972678 on \text{'}November 3, 2008\text{'}}}{,}{\mathrm{4.098360656 on \text{'}December 3, 2008\text{'}}}{,}{\mathrm{4.235721237 on \text{'}January 3, 2009\text{'}}}{,}{\mathrm{4.246575342 on \text{'}February 3, 2009\text{'}}}{,}{\mathrm{3.835616438 on \text{'}March 3, 2009\text{'}}}{,}{\mathrm{4.246575342 on \text{'}April 3, 2009\text{'}}}{,}{\mathrm{4.109589041 on \text{'}May 3, 2009\text{'}}}{,}{\mathrm{4.246575342 on \text{'}June 3, 2009\text{'}}}{,}{\mathrm{4.109589041 on \text{'}July 3, 2009\text{'}}}{,}{\mathrm{4.246575342 on \text{'}August 3, 2009\text{'}}}{,}{\mathrm{4.246575342 on \text{'}September 3, 2009\text{'}}}{,}{\mathrm{4.109589041 on \text{'}October 3, 2009\text{'}}}{,}{\mathrm{4.246575342 on \text{'}November 3, 2009\text{'}}}{,}{\mathrm{4.109589041 on \text{'}December 3, 2009\text{'}}}{,}{\mathrm{4.246575342 on \text{'}January 3, 2010\text{'}}}{,}{\mathrm{4.246575342 on \text{'}February 3, 2010\text{'}}}{,}{\mathrm{3.835616438 on \text{'}March 3, 2010\text{'}}}{,}{\mathrm{4.246575342 on \text{'}April 3, 2010\text{'}}}{,}{\mathrm{4.109589041 on \text{'}May 3, 2010\text{'}}}{,}{\mathrm{4.246575342 on \text{'}June 3, 2010\text{'}}}{,}{\mathrm{4.109589041 on \text{'}July 3, 2010\text{'}}}{,}{\mathrm{4.246575342 on \text{'}August 3, 2010\text{'}}}{,}{\mathrm{4.246575342 on \text{'}September 3, 2010\text{'}}}{,}{\mathrm{4.109589041 on \text{'}October 3, 2010\text{'}}}{,}{\mathrm{4.246575342 on \text{'}November 3, 2010\text{'}}}{,}{\mathrm{4.109589041 on \text{'}December 3, 2010\text{'}}}{,}{\mathrm{4.246575342 on \text{'}January 3, 2011\text{'}}}{,}{\mathrm{4.246575342 on \text{'}February 3, 2011\text{'}}}{,}{\mathrm{3.835616438 on \text{'}March 3, 2011\text{'}}}{,}{\mathrm{4.246575342 on \text{'}April 3, 2011\text{'}}}{,}{\mathrm{4.109589041 on \text{'}May 3, 2011\text{'}}}{,}{\mathrm{4.246575342 on \text{'}June 3, 2011\text{'}}}{,}{\mathrm{4.109589041 on \text{'}July 3, 2011\text{'}}}{,}{\mathrm{4.246575342 on \text{'}August 3, 2011\text{'}}}{,}{\mathrm{4.246575342 on \text{'}September 3, 2011\text{'}}}{,}{\mathrm{4.109589041 on \text{'}October 3, 2011\text{'}}}{,}{\mathrm{4.246575342 on \text{'}November 3, 2011\text{'}}}{,}{\mathrm{4.109589041 on \text{'}December 3, 2011\text{'}}}{,}{\mathrm{4.245826783 on \text{'}January 3, 2012\text{'}}}{,}{\mathrm{4.234972678 on \text{'}February 3, 2012\text{'}}}{,}{\mathrm{3.961748634 on \text{'}March 3, 2012\text{'}}}{,}{\mathrm{4.234972678 on \text{'}April 3, 2012\text{'}}}{,}{\mathrm{4.098360656 on \text{'}May 3, 2012\text{'}}}{,}{\mathrm{4.234972678 on \text{'}June 3, 2012\text{'}}}{,}{\mathrm{4.098360656 on \text{'}July 3, 2012\text{'}}}{,}{\mathrm{4.234972678 on \text{'}August 3, 2012\text{'}}}{,}{\mathrm{4.234972678 on \text{'}September 3, 2012\text{'}}}{,}{\mathrm{4.098360656 on \text{'}October 3, 2012\text{'}}}{,}{\mathrm{4.234972678 on \text{'}November 3, 2012\text{'}}}{,}{\mathrm{4.098360656 on \text{'}December 3, 2012\text{'}}}{,}{\mathrm{4.235721237 on \text{'}January 3, 2013\text{'}}}{,}{\mathrm{4.246575342 on \text{'}February 3, 2013\text{'}}}{,}{\mathrm{3.835616438 on \text{'}March 3, 2013\text{'}}}{,}{\mathrm{4.246575342 on \text{'}April 3, 2013\text{'}}}{,}{\mathrm{4.109589041 on \text{'}May 3, 2013\text{'}}}{,}{\mathrm{4.246575342 on \text{'}June 3, 2013\text{'}}}{,}{\mathrm{4.109589041 on \text{'}July 3, 2013\text{'}}}{,}{\mathrm{4.246575342 on \text{'}August 3, 2013\text{'}}}{,}{\mathrm{4.246575342 on \text{'}September 3, 2013\text{'}}}{,}{\mathrm{4.109589041 on \text{'}October 3, 2013\text{'}}}{,}{\mathrm{4.246575342 on \text{'}November 3, 2013\text{'}}}{,}{\mathrm{4.109589041 on \text{'}December 3, 2013\text{'}}}{,}{\mathrm{4.246575342 on \text{'}January 3, 2014\text{'}}}{,}{\mathrm{4.246575342 on \text{'}February 3, 2014\text{'}}}{,}{\mathrm{3.835616438 on \text{'}March 3, 2014\text{'}}}{,}{\mathrm{4.246575342 on \text{'}April 3, 2014\text{'}}}{,}{\mathrm{4.109589041 on \text{'}May 3, 2014\text{'}}}{,}{\mathrm{4.246575342 on \text{'}June 3, 2014\text{'}}}{,}{\mathrm{4.109589041 on \text{'}July 3, 2014\text{'}}}{,}{\mathrm{4.246575342 on \text{'}August 3, 2014\text{'}}}{,}{\mathrm{4.246575342 on \text{'}September 3, 2014\text{'}}}{,}{\mathrm{4.109589041 on \text{'}October 3, 2014\text{'}}}{,}{\mathrm{4.246575342 on \text{'}November 3, 2014\text{'}}}{,}{\mathrm{4.109589041 on \text{'}December 3, 2014\text{'}}}{,}{\mathrm{4.246575342 on \text{'}January 3, 2015\text{'}}}{,}{\mathrm{4.246575342 on \text{'}February 3, 2015\text{'}}}{,}{\mathrm{3.835616438 on \text{'}March 3, 2015\text{'}}}{,}{\mathrm{4.246575342 on \text{'}April 3, 2015\text{'}}}{,}{\mathrm{4.109589041 on \text{'}May 3, 2015\text{'}}}{,}{\mathrm{4.246575342 on \text{'}June 3, 2015\text{'}}}{,}{\mathrm{4.109589041 on \text{'}July 3, 2015\text{'}}}{,}{\mathrm{4.246575342 on \text{'}August 3, 2015\text{'}}}{,}{\mathrm{4.246575342 on \text{'}September 3, 2015\text{'}}}{,}{\mathrm{4.109589041 on \text{'}October 3, 2015\text{'}}}{,}{\mathrm{4.246575342 on \text{'}November 3, 2015\text{'}}}{,}{\mathrm{4.109589041 on \text{'}December 3, 2015\text{'}}}{,}{\mathrm{4.245826783 on \text{'}January 3, 2016\text{'}}}{,}{\mathrm{4.234972678 on \text{'}February 3, 2016\text{'}}}{,}{\mathrm{3.961748634 on \text{'}March 3, 2016\text{'}}}{,}{\mathrm{4.234972678 on \text{'}April 3, 2016\text{'}}}{,}{\mathrm{4.098360656 on \text{'}May 3, 2016\text{'}}}{,}{\mathrm{4.234972678 on \text{'}June 3, 2016\text{'}}}{,}{\mathrm{4.098360656 on \text{'}July 3, 2016\text{'}}}{,}{\mathrm{4.234972678 on \text{'}August 3, 2016\text{'}}}{,}{\mathrm{4.234972678 on \text{'}September 3, 2016\text{'}}}{,}{\mathrm{4.098360656 on \text{'}October 3, 2016\text{'}}}{,}{\mathrm{4.234972678 on \text{'}November 3, 2016\text{'}}}{,}{\mathrm{4.098360656 on \text{'}December 3, 2016\text{'}}}{,}{\mathrm{4.235721237 on \text{'}January 3, 2017\text{'}}}{,}{\mathrm{4.246575342 on \text{'}February 3, 2017\text{'}}}{,}{\mathrm{3.835616438 on \text{'}March 3, 2017\text{'}}}{,}{\mathrm{4.246575342 on \text{'}April 3, 2017\text{'}}}{,}{\mathrm{4.109589041 on \text{'}May 3, 2017\text{'}}}{,}{\mathrm{4.246575342 on \text{'}June 3, 2017\text{'}}}{,}{\mathrm{4.109589041 on \text{'}July 3, 2017\text{'}}}{,}{\mathrm{4.246575342 on \text{'}August 3, 2017\text{'}}}{,}{\mathrm{4.246575342 on \text{'}September 3, 2017\text{'}}}{,}{\mathrm{4.109589041 on \text{'}October 3, 2017\text{'}}}{,}{\mathrm{4.246575342 on \text{'}November 3, 2017\text{'}}}{,}{\mathrm{4.109589041 on \text{'}December 3, 2017\text{'}}}{,}{\mathrm{4.246575342 on \text{'}January 3, 2018\text{'}}}\right]$ (9)
 > $\mathrm{PayingLeg2}≔\mathrm{CashFlows}\left(\mathrm{Swap2},\mathrm{paying}\right)$
 ${\mathrm{PayingLeg2}}{≔}\left[{\mathrm{14.82194787 on \text{'}April 3, 2010\text{'}}}{,}{\mathrm{14.98694508 on \text{'}July 3, 2010\text{'}}}{,}{\mathrm{15.15194910 on \text{'}October 3, 2010\text{'}}}{,}{\mathrm{15.15194910 on \text{'}January 3, 2011\text{'}}}{,}{\mathrm{14.82194787 on \text{'}April 3, 2011\text{'}}}{,}{\mathrm{14.98694508 on \text{'}July 3, 2011\text{'}}}{,}{\mathrm{15.15194910 on \text{'}October 3, 2011\text{'}}}{,}{\mathrm{15.15127369 on \text{'}January 3, 2012\text{'}}}{,}{\mathrm{14.94592054 on \text{'}April 3, 2012\text{'}}}{,}{\mathrm{14.94592054 on \text{'}July 3, 2012\text{'}}}{,}{\mathrm{15.11047204 on \text{'}October 3, 2012\text{'}}}{,}{\mathrm{15.11114744 on \text{'}January 3, 2013\text{'}}}{,}{\mathrm{14.82194787 on \text{'}April 3, 2013\text{'}}}{,}{\mathrm{14.98694508 on \text{'}July 3, 2013\text{'}}}{,}{\mathrm{15.15194910 on \text{'}October 3, 2013\text{'}}}{,}{\mathrm{15.15194910 on \text{'}January 3, 2014\text{'}}}{,}{\mathrm{14.82194787 on \text{'}April 3, 2014\text{'}}}{,}{\mathrm{14.98694508 on \text{'}July 3, 2014\text{'}}}{,}{\mathrm{15.15194910 on \text{'}October 3, 2014\text{'}}}{,}{\mathrm{15.15194910 on \text{'}January 3, 2015\text{'}}}\right]$ (10)

Here is the set of cash flows for the receiving leg.

 > $\mathrm{ReceivingLeg1}≔\mathrm{CashFlows}\left(\mathrm{Swap1},\mathrm{receiving}\right)$
 ${\mathrm{ReceivingLeg1}}{≔}\left[{\mathrm{14.82194787 on \text{'}April 3, 2010\text{'}}}{,}{\mathrm{14.98694508 on \text{'}July 3, 2010\text{'}}}{,}{\mathrm{15.15194910 on \text{'}October 3, 2010\text{'}}}{,}{\mathrm{15.15194910 on \text{'}January 3, 2011\text{'}}}{,}{\mathrm{14.82194787 on \text{'}April 3, 2011\text{'}}}{,}{\mathrm{14.98694508 on \text{'}July 3, 2011\text{'}}}{,}{\mathrm{15.15194910 on \text{'}October 3, 2011\text{'}}}{,}{\mathrm{15.15127369 on \text{'}January 3, 2012\text{'}}}{,}{\mathrm{14.94592054 on \text{'}April 3, 2012\text{'}}}{,}{\mathrm{14.94592054 on \text{'}July 3, 2012\text{'}}}{,}{\mathrm{15.11047204 on \text{'}October 3, 2012\text{'}}}{,}{\mathrm{15.11114744 on \text{'}January 3, 2013\text{'}}}{,}{\mathrm{14.82194787 on \text{'}April 3, 2013\text{'}}}{,}{\mathrm{14.98694508 on \text{'}July 3, 2013\text{'}}}{,}{\mathrm{15.15194910 on \text{'}October 3, 2013\text{'}}}{,}{\mathrm{15.15194910 on \text{'}January 3, 2014\text{'}}}{,}{\mathrm{14.82194787 on \text{'}April 3, 2014\text{'}}}{,}{\mathrm{14.98694508 on \text{'}July 3, 2014\text{'}}}{,}{\mathrm{15.15194910 on \text{'}October 3, 2014\text{'}}}{,}{\mathrm{15.15194910 on \text{'}January 3, 2015\text{'}}}\right]$ (11)
 > $\mathrm{ReceivingLeg2}≔\mathrm{CashFlows}\left(\mathrm{Swap2},\mathrm{receiving}\right)$
 ${\mathrm{ReceivingLeg2}}{≔}\left[{\mathrm{4.234972678 on \text{'}February 3, 2008\text{'}}}{,}{\mathrm{3.961748634 on \text{'}March 3, 2008\text{'}}}{,}{\mathrm{4.234972678 on \text{'}April 3, 2008\text{'}}}{,}{\mathrm{4.098360656 on \text{'}May 3, 2008\text{'}}}{,}{\mathrm{4.234972678 on \text{'}June 3, 2008\text{'}}}{,}{\mathrm{4.098360656 on \text{'}July 3, 2008\text{'}}}{,}{\mathrm{4.234972678 on \text{'}August 3, 2008\text{'}}}{,}{\mathrm{4.234972678 on \text{'}September 3, 2008\text{'}}}{,}{\mathrm{4.098360656 on \text{'}October 3, 2008\text{'}}}{,}{\mathrm{4.234972678 on \text{'}November 3, 2008\text{'}}}{,}{\mathrm{4.098360656 on \text{'}December 3, 2008\text{'}}}{,}{\mathrm{4.235721237 on \text{'}January 3, 2009\text{'}}}{,}{\mathrm{4.246575342 on \text{'}February 3, 2009\text{'}}}{,}{\mathrm{3.835616438 on \text{'}March 3, 2009\text{'}}}{,}{\mathrm{4.246575342 on \text{'}April 3, 2009\text{'}}}{,}{\mathrm{4.109589041 on \text{'}May 3, 2009\text{'}}}{,}{\mathrm{4.246575342 on \text{'}June 3, 2009\text{'}}}{,}{\mathrm{4.109589041 on \text{'}July 3, 2009\text{'}}}{,}{\mathrm{4.246575342 on \text{'}August 3, 2009\text{'}}}{,}{\mathrm{4.246575342 on \text{'}September 3, 2009\text{'}}}{,}{\mathrm{4.109589041 on \text{'}October 3, 2009\text{'}}}{,}{\mathrm{4.246575342 on \text{'}November 3, 2009\text{'}}}{,}{\mathrm{4.109589041 on \text{'}December 3, 2009\text{'}}}{,}{\mathrm{4.246575342 on \text{'}January 3, 2010\text{'}}}{,}{\mathrm{4.246575342 on \text{'}February 3, 2010\text{'}}}{,}{\mathrm{3.835616438 on \text{'}March 3, 2010\text{'}}}{,}{\mathrm{4.246575342 on \text{'}April 3, 2010\text{'}}}{,}{\mathrm{4.109589041 on \text{'}May 3, 2010\text{'}}}{,}{\mathrm{4.246575342 on \text{'}June 3, 2010\text{'}}}{,}{\mathrm{4.109589041 on \text{'}July 3, 2010\text{'}}}{,}{\mathrm{4.246575342 on \text{'}August 3, 2010\text{'}}}{,}{\mathrm{4.246575342 on \text{'}September 3, 2010\text{'}}}{,}{\mathrm{4.109589041 on \text{'}October 3, 2010\text{'}}}{,}{\mathrm{4.246575342 on \text{'}November 3, 2010\text{'}}}{,}{\mathrm{4.109589041 on \text{'}December 3, 2010\text{'}}}{,}{\mathrm{4.246575342 on \text{'}January 3, 2011\text{'}}}{,}{\mathrm{4.246575342 on \text{'}February 3, 2011\text{'}}}{,}{\mathrm{3.835616438 on \text{'}March 3, 2011\text{'}}}{,}{\mathrm{4.246575342 on \text{'}April 3, 2011\text{'}}}{,}{\mathrm{4.109589041 on \text{'}May 3, 2011\text{'}}}{,}{\mathrm{4.246575342 on \text{'}June 3, 2011\text{'}}}{,}{\mathrm{4.109589041 on \text{'}July 3, 2011\text{'}}}{,}{\mathrm{4.246575342 on \text{'}August 3, 2011\text{'}}}{,}{\mathrm{4.246575342 on \text{'}September 3, 2011\text{'}}}{,}{\mathrm{4.109589041 on \text{'}October 3, 2011\text{'}}}{,}{\mathrm{4.246575342 on \text{'}November 3, 2011\text{'}}}{,}{\mathrm{4.109589041 on \text{'}December 3, 2011\text{'}}}{,}{\mathrm{4.245826783 on \text{'}January 3, 2012\text{'}}}{,}{\mathrm{4.234972678 on \text{'}February 3, 2012\text{'}}}{,}{\mathrm{3.961748634 on \text{'}March 3, 2012\text{'}}}{,}{\mathrm{4.234972678 on \text{'}April 3, 2012\text{'}}}{,}{\mathrm{4.098360656 on \text{'}May 3, 2012\text{'}}}{,}{\mathrm{4.234972678 on \text{'}June 3, 2012\text{'}}}{,}{\mathrm{4.098360656 on \text{'}July 3, 2012\text{'}}}{,}{\mathrm{4.234972678 on \text{'}August 3, 2012\text{'}}}{,}{\mathrm{4.234972678 on \text{'}September 3, 2012\text{'}}}{,}{\mathrm{4.098360656 on \text{'}October 3, 2012\text{'}}}{,}{\mathrm{4.234972678 on \text{'}November 3, 2012\text{'}}}{,}{\mathrm{4.098360656 on \text{'}December 3, 2012\text{'}}}{,}{\mathrm{4.235721237 on \text{'}January 3, 2013\text{'}}}{,}{\mathrm{4.246575342 on \text{'}February 3, 2013\text{'}}}{,}{\mathrm{3.835616438 on \text{'}March 3, 2013\text{'}}}{,}{\mathrm{4.246575342 on \text{'}April 3, 2013\text{'}}}{,}{\mathrm{4.109589041 on \text{'}May 3, 2013\text{'}}}{,}{\mathrm{4.246575342 on \text{'}June 3, 2013\text{'}}}{,}{\mathrm{4.109589041 on \text{'}July 3, 2013\text{'}}}{,}{\mathrm{4.246575342 on \text{'}August 3, 2013\text{'}}}{,}{\mathrm{4.246575342 on \text{'}September 3, 2013\text{'}}}{,}{\mathrm{4.109589041 on \text{'}October 3, 2013\text{'}}}{,}{\mathrm{4.246575342 on \text{'}November 3, 2013\text{'}}}{,}{\mathrm{4.109589041 on \text{'}December 3, 2013\text{'}}}{,}{\mathrm{4.246575342 on \text{'}January 3, 2014\text{'}}}{,}{\mathrm{4.246575342 on \text{'}February 3, 2014\text{'}}}{,}{\mathrm{3.835616438 on \text{'}March 3, 2014\text{'}}}{,}{\mathrm{4.246575342 on \text{'}April 3, 2014\text{'}}}{,}{\mathrm{4.109589041 on \text{'}May 3, 2014\text{'}}}{,}{\mathrm{4.246575342 on \text{'}June 3, 2014\text{'}}}{,}{\mathrm{4.109589041 on \text{'}July 3, 2014\text{'}}}{,}{\mathrm{4.246575342 on \text{'}August 3, 2014\text{'}}}{,}{\mathrm{4.246575342 on \text{'}September 3, 2014\text{'}}}{,}{\mathrm{4.109589041 on \text{'}October 3, 2014\text{'}}}{,}{\mathrm{4.246575342 on \text{'}November 3, 2014\text{'}}}{,}{\mathrm{4.109589041 on \text{'}December 3, 2014\text{'}}}{,}{\mathrm{4.246575342 on \text{'}January 3, 2015\text{'}}}{,}{\mathrm{4.246575342 on \text{'}February 3, 2015\text{'}}}{,}{\mathrm{3.835616438 on \text{'}March 3, 2015\text{'}}}{,}{\mathrm{4.246575342 on \text{'}April 3, 2015\text{'}}}{,}{\mathrm{4.109589041 on \text{'}May 3, 2015\text{'}}}{,}{\mathrm{4.246575342 on \text{'}June 3, 2015\text{'}}}{,}{\mathrm{4.109589041 on \text{'}July 3, 2015\text{'}}}{,}{\mathrm{4.246575342 on \text{'}August 3, 2015\text{'}}}{,}{\mathrm{4.246575342 on \text{'}September 3, 2015\text{'}}}{,}{\mathrm{4.109589041 on \text{'}October 3, 2015\text{'}}}{,}{\mathrm{4.246575342 on \text{'}November 3, 2015\text{'}}}{,}{\mathrm{4.109589041 on \text{'}December 3, 2015\text{'}}}{,}{\mathrm{4.245826783 on \text{'}January 3, 2016\text{'}}}{,}{\mathrm{4.234972678 on \text{'}February 3, 2016\text{'}}}{,}{\mathrm{3.961748634 on \text{'}March 3, 2016\text{'}}}{,}{\mathrm{4.234972678 on \text{'}April 3, 2016\text{'}}}{,}{\mathrm{4.098360656 on \text{'}May 3, 2016\text{'}}}{,}{\mathrm{4.234972678 on \text{'}June 3, 2016\text{'}}}{,}{\mathrm{4.098360656 on \text{'}July 3, 2016\text{'}}}{,}{\mathrm{4.234972678 on \text{'}August 3, 2016\text{'}}}{,}{\mathrm{4.234972678 on \text{'}September 3, 2016\text{'}}}{,}{\mathrm{4.098360656 on \text{'}October 3, 2016\text{'}}}{,}{\mathrm{4.234972678 on \text{'}November 3, 2016\text{'}}}{,}{\mathrm{4.098360656 on \text{'}December 3, 2016\text{'}}}{,}{\mathrm{4.235721237 on \text{'}January 3, 2017\text{'}}}{,}{\mathrm{4.246575342 on \text{'}February 3, 2017\text{'}}}{,}{\mathrm{3.835616438 on \text{'}March 3, 2017\text{'}}}{,}{\mathrm{4.246575342 on \text{'}April 3, 2017\text{'}}}{,}{\mathrm{4.109589041 on \text{'}May 3, 2017\text{'}}}{,}{\mathrm{4.246575342 on \text{'}June 3, 2017\text{'}}}{,}{\mathrm{4.109589041 on \text{'}July 3, 2017\text{'}}}{,}{\mathrm{4.246575342 on \text{'}August 3, 2017\text{'}}}{,}{\mathrm{4.246575342 on \text{'}September 3, 2017\text{'}}}{,}{\mathrm{4.109589041 on \text{'}October 3, 2017\text{'}}}{,}{\mathrm{4.246575342 on \text{'}November 3, 2017\text{'}}}{,}{\mathrm{4.109589041 on \text{'}December 3, 2017\text{'}}}{,}{\mathrm{4.246575342 on \text{'}January 3, 2018\text{'}}}\right]$ (12)
 > $\mathrm{Swap3}≔\mathrm{Swap}\left(\mathrm{PayingLeg1},\mathrm{ReceivingLeg1}\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{Swap}\left(\mathrm{PayingLeg2},\mathrm{ReceivingLeg2}\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},0.05\right)$
 ${-146.0132438}$ (15)
 > $\mathrm{NetPresentValue}\left(\mathrm{Swap4},0.05\right)$
 ${146.0132438}$ (16)

Compatibility

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