Class Swap

    • Constructor Detail

      • Swap

        public Swap​(AnalyticProduct legReceiver,
                    AnalyticProduct legPayer)
        Create a swap which values as legReceiver - legPayer.
        Parameters:
        legReceiver - The receiver leg.
        legPayer - The payler 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.