Class Swap

All Implemented Interfaces:
Serializable, AnalyticProduct, DescribedProduct<InterestRateSwapProductDescriptor>, Product

Implements the valuation of a swap using curves (discount curve, forward curve). The swap valuation supports distinct discounting and forward curve. Support for day counting is limited to the capabilities of TimeDiscretization. The swap is just the composition of two SwapLegs, namely the receiver leg and the payer leg. The value of the swap is the value of the receiver leg minus the value of the payer leg.
Version:
1.0
Author:
Christian Fries
See Also:
  • Constructor Details

    • Swap

      public Swap(AnalyticProduct legReceiver, AnalyticProduct legPayer)
      Create a swap which values as legReceiver - legPayer.
      Parameters:
      legReceiver - The receiver leg.
      legPayer - The payer leg.
    • Swap

      public Swap(Schedule scheduleReceiveLeg, String forwardCurveReceiveName, double spreadReceive, String discountCurveReceiveName, Schedule schedulePayLeg, String forwardCurvePayName, double spreadPay, String discountCurvePayName, boolean isNotionalExchanged)
      Creates a swap with notional exchange. The swap has a unit notional of 1.
      Parameters:
      scheduleReceiveLeg - ScheduleFromPeriods of the receiver leg.
      forwardCurveReceiveName - Name of the forward curve, leave empty if this is a fix leg.
      spreadReceive - Fixed spread on the forward or fix rate.
      discountCurveReceiveName - Name of the discount curve for the receiver leg.
      schedulePayLeg - ScheduleFromPeriods of the payer leg.
      forwardCurvePayName - Name of the forward curve, leave empty if this is a fix leg.
      spreadPay - Fixed spread on the forward or fix rate.
      discountCurvePayName - Name of the discount curve for the payer leg.
      isNotionalExchanged - If true, both leg will pay notional at the beginning of each swap period and receive notional at the end of the swap period. Note that the cash flow date for the notional is periodStart and periodEnd (not fixingDate and paymentDate).
    • Swap

      public Swap(Schedule scheduleReceiveLeg, String forwardCurveReceiveName, double spreadReceive, String discountCurveReceiveName, Schedule schedulePayLeg, String forwardCurvePayName, double spreadPay, String discountCurvePayName)
      Creates a swap with notional exchange. The swap has a unit notional of 1.
      Parameters:
      scheduleReceiveLeg - ScheduleFromPeriods of the receiver leg.
      forwardCurveReceiveName - Name of the forward curve, leave empty if this is a fix leg.
      spreadReceive - Fixed spread on the forward or fix rate.
      discountCurveReceiveName - Name of the discount curve for the receiver leg.
      schedulePayLeg - ScheduleFromPeriods of the payer leg.
      forwardCurvePayName - Name of the forward curve, leave empty if this is a fix leg.
      spreadPay - Fixed spread on the forward or fix rate.
      discountCurvePayName - Name of the discount curve for the payer leg.
    • Swap

      public Swap(Schedule scheduleReceiveLeg, double spreadReceive, String discountCurveReceiveName, Schedule schedulePayLeg, String forwardCurvePayName, String discountCurvePayName)
      Creates a swap with notional exchange. The swap has a unit notional of 1.
      Parameters:
      scheduleReceiveLeg - ScheduleFromPeriods of the receiver leg.
      spreadReceive - Fixed spread on the forward or fix rate.
      discountCurveReceiveName - Name of the discount curve for the receiver leg.
      schedulePayLeg - ScheduleFromPeriods of the payer leg.
      forwardCurvePayName - Name of the forward curve, leave empty if this is a fix leg.
      discountCurvePayName - Name of the discount curve for the payer leg.
  • Method Details