VanillaSwap¶
- class VanillaSwap(Type type, Real nominal, Schedule fixed_schedule, Rate fixed_rate, DayCounter fixed_daycount, Schedule float_schedule, IborIndex ibor_index, Spread spread, DayCounter floating_daycount, int payment_convention=-1)¶
Bases:
FixedVsFloatingSwapPlain-vanilla swap: fix vs ibor leg.
- Parameters:
- type
Type The swap type, either Payer or Receiver.
- nominalfloat
The swap nominal.
- fixed_schedule
Schedule The schedule for the fixed leg.
- fixed_ratefloat
The fixed rate.
- fixed_daycount
DayCounter The day counter for the fixed leg.
- float_schedule
Schedule The schedule for the floating leg.
- ibor_index
IborIndex The IBOR index for the floating leg.
- spreadfloat
The spread over the IBOR index.
- floating_daycount
DayCounter The day counter for the floating leg.
- payment_conventionint, optional
The business day convention for payment dates.
- type
- Attributes:
error_estimateReal: error estimate on the NPV when available- fair_rate
- fair_spread
- fixed_day_count
- fixed_leg
- fixed_leg_BPS
- fixed_leg_NPV
- fixed_rate
- fixed_schedule
- floating_day_count
- floating_leg
- floating_leg_BPS
- floating_leg_NPV
- floating_schedule
is_expiredbool: whether the instrument might have value greater than zero.maturity_dateThe maturity date of the swap.
net_present_valueThe net present value of the instrument.
- nominal
- nominals
npvA shortcut to the net_present_value property.
- spread
start_dateThe start date of the swap.
- type
valuation_dateDate: the date the net present value refers to.
Methods
endDiscounts(self, Size j)The discount factor at the end of the j-th leg of the swap.
leg(self, Size i)The i-th leg of the swap.
leg_BPS(self, Size j)The basis-point sensitivity of the j-th leg of the swap.
leg_NPV(self, Size j)The net present value of the j-th leg of the swap.
npv_date_discount(self)The discount factor at the NPV date.
set_pricing_engine(self, PricingEngine engine)Sets the pricing engine to be used.
startDiscounts(self, Size j)The discount factor at the start of the j-th leg of the swap.