Class implements an plain vanilla (flo/fix) interest rate swap contract. More...

#include <IRS.hpp>

Inheritance diagram for julian::IRS:
julian::LinearInstrument julian::ir::BuildingBlock

Public Member Functions

 IRS ()
 Default constructor. More...
 
 IRS (Date trade_date, Date start_date, Date maturity_date, CashFlowVector fixed_leg, CashFlowVector floating_leg, InterestRate fixed_leg_rate, InterestRate floating_leg_rate, double notional, double quoting, Frequency fixed_leg_freq, Frequency floating_leg_freq)
 Constructor. More...
 
virtual IRSclone () const
 Virtual copy constructor. More...
 
Linear instrument interface
virtual double price (const SmartPointer< ir::Curve > &)
 calculates price of IRS by summing the discounted CFs More...
 
virtual double price (const SmartPointer< ir::Curve > &discounting, const SmartPointer< ir::Curve > &projecting, const SmartPointer< ir::Curve > &, const SmartPointer< ir::Curve > &)
 calculates price of IRS by summing the discounted CFs More...
 
virtual void valuation (const SmartPointer< ir::Curve > &)
 prints price and CFs of IRS More...
 
virtual void valuation (const SmartPointer< ir::Curve > &discounting, const SmartPointer< ir::Curve > &projecting, const SmartPointer< ir::Curve > &, const SmartPointer< ir::Curve > &)
 prints price and CFs of IRS More...
 
Building Block interface
virtual Date getDate () const override
 returns maturity of IRS More...
 
virtual std::pair< CashFlowVector, CashFlowVectorgetCFs () const override
 Returns the sets of cashflows associated with IRS. More...
 
virtual double calibrate (const SmartPointer< ir::Curve > &calibrated) override
 Method calibrate is used by root finding estimator. More...
 
virtual double calibrate (const SmartPointer< ir::Curve > &discounting, const SmartPointer< ir::Curve > &projection, const SmartPointer< ir::Curve > &calibrated) override
 Method calibrate is used by root finding estimator. More...
 
virtual double getParRate (const SmartPointer< ir::Curve > &discounting, const SmartPointer< ir::Curve > &projection, const SmartPointer< ir::Curve > &projection2) override
 Implies quoting of benchmark instrument from interest rate curves provided. More...
 
virtual double getQuoting () override
 Returns quoting. More...
 
virtual void changeQuoting (double) override
 changes quoting of the IRS More...
 
virtual InterestRate getInterestRate () const override
 Returns interest rates convention of fixed leg. More...
 
std::string info () const override
 Returns a name of instrument: FRA. More...
 
- Public Member Functions inherited from julian::LinearInstrument
 LinearInstrument ()
 constructor More...
 
virtual ~LinearInstrument ()
 destructor More...
 
- Public Member Functions inherited from julian::ir::BuildingBlock
virtual ~BuildingBlock ()
 destructor More...
 

Private Attributes

Date trade_date_
 The date on which IRS is dealt. More...
 
Date start_date_
 The date initial date of first accrual period. More...
 
Date maturity_date_
 The date on which the IRS expires. More...
 
CashFlowVector fixed_leg_
 Fixed leg cash flows. More...
 
CashFlowVector floating_leg_
 Floating leg cash flows. More...
 
InterestRate fixed_leg_rate_
 Convention of fixed leg interest rate. More...
 
InterestRate floating_leg_rate_
 Convention of floating leg interest rate. More...
 
double notional_
 The amount for which IRS is traded. More...
 
double quoting_
 Interest rate at which IRS is paying fixed leg. More...
 
Frequency fixed_leg_freq_
 Frequency of payment of fixed leg. More...
 
Frequency floating_leg_freq_
 Frequency of payment of floating leg. More...
 

Friends

std::ostream & operator<< (std::ostream &, IRS &)
 Overloads stream operator. More...
 

Detailed Description

Class implements an plain vanilla (flo/fix) interest rate swap contract.

IRS is an agreement between two counter-parties to make periodic interest payments to one another during the life of the swap, on a predetermined set of dates, based on a notional principal amount. One party is the fixed-rate payer (rate is agreed at the time of trade of the swap); other party is the floating-rate payer (rate is determined during the life of the swap)

For more details see [3] and [31].

Examples:
bootstrapperComparison.cpp.

Constructor & Destructor Documentation

julian::IRS::IRS ( )
inline

Default constructor.

julian::IRS::IRS ( Date  trade_date,
Date  start_date,
Date  maturity_date,
CashFlowVector  fixed_leg,
CashFlowVector  floating_leg,
InterestRate  fixed_leg_rate,
InterestRate  floating_leg_rate,
double  notional,
double  quoting,
Frequency  fixed_leg_freq,
Frequency  floating_leg_freq 
)
inline

Constructor.

Member Function Documentation

double julian::IRS::calibrate ( const SmartPointer< ir::Curve > &  calibrated)
overridevirtual

Method calibrate is used by root finding estimator.

The estimator calibrates curve by finding the root of this method.

Calibrated curve is used to price the fixed leg.

Implements julian::ir::BuildingBlock.

double julian::IRS::calibrate ( const SmartPointer< ir::Curve > &  discounting,
const SmartPointer< ir::Curve > &  projection,
const SmartPointer< ir::Curve > &  calibrated 
)
overridevirtual

Method calibrate is used by root finding estimator.

The estimator calibrates curve by finding the root of this method.

Calibrated curve is used as projection curve for floating leg. Discounting curve is used to prize fixed and floating leg.

Implements julian::ir::BuildingBlock.

void julian::IRS::changeQuoting ( double  input)
overridevirtual

changes quoting of the IRS

Implements julian::ir::BuildingBlock.

IRS * julian::IRS::clone ( ) const
virtual

Virtual copy constructor.

Implements julian::LinearInstrument.

std::pair< CashFlowVector, CashFlowVector > julian::IRS::getCFs ( ) const
overridevirtual

Returns the sets of cashflows associated with IRS.

Implements julian::ir::BuildingBlock.

Date julian::IRS::getDate ( ) const
overridevirtual

returns maturity of IRS

Implements julian::ir::BuildingBlock.

InterestRate julian::IRS::getInterestRate ( ) const
overridevirtual

Returns interest rates convention of fixed leg.

Implements julian::ir::BuildingBlock.

double julian::IRS::getParRate ( const SmartPointer< ir::Curve > &  discounting,
const SmartPointer< ir::Curve > &  projection,
const SmartPointer< ir::Curve > &  projection2 
)
overridevirtual

Implies quoting of benchmark instrument from interest rate curves provided.

Implements julian::ir::BuildingBlock.

double julian::IRS::getQuoting ( )
overridevirtual

Returns quoting.

Implements julian::ir::BuildingBlock.

std::string julian::IRS::info ( ) const
overridevirtual

Returns a name of instrument: FRA.

Implements julian::ir::BuildingBlock.

double julian::IRS::price ( const SmartPointer< ir::Curve > &  c)
virtual

calculates price of IRS by summing the discounted CFs

Parameters
cdiscounting curve

Implements julian::LinearInstrument.

double julian::IRS::price ( const SmartPointer< ir::Curve > &  discounting,
const SmartPointer< ir::Curve > &  projecting,
const SmartPointer< ir::Curve > &  ,
const SmartPointer< ir::Curve > &   
)
virtual

calculates price of IRS by summing the discounted CFs

Projecting curve is used to estimate CFs generated by floating leg. Discounting curve is used to discount CFs of both leg.

Parameters
discountingdiscounting curve
projectingprojecting curve

Implements julian::LinearInstrument.

void julian::IRS::valuation ( const SmartPointer< ir::Curve > &  c)
virtual

prints price and CFs of IRS

Implements julian::LinearInstrument.

void julian::IRS::valuation ( const SmartPointer< ir::Curve > &  discounting,
const SmartPointer< ir::Curve > &  projecting,
const SmartPointer< ir::Curve > &  ,
const SmartPointer< ir::Curve > &   
)
virtual

prints price and CFs of IRS

Implements julian::LinearInstrument.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
IRS irs 
)
friend

Overloads stream operator.

This overloaded operator enables to print the curve on the console.

Member Data Documentation

CashFlowVector julian::IRS::fixed_leg_
private

Fixed leg cash flows.

Frequency julian::IRS::fixed_leg_freq_
private

Frequency of payment of fixed leg.

InterestRate julian::IRS::fixed_leg_rate_
private

Convention of fixed leg interest rate.

CashFlowVector julian::IRS::floating_leg_
private

Floating leg cash flows.

Frequency julian::IRS::floating_leg_freq_
private

Frequency of payment of floating leg.

InterestRate julian::IRS::floating_leg_rate_
private

Convention of floating leg interest rate.

Date julian::IRS::maturity_date_
private

The date on which the IRS expires.

double julian::IRS::notional_
private

The amount for which IRS is traded.

double julian::IRS::quoting_
private

Interest rate at which IRS is paying fixed leg.

Date julian::IRS::start_date_
private

The date initial date of first accrual period.

Date julian::IRS::trade_date_
private

The date on which IRS is dealt.


The documentation for this class was generated from the following files:
  • C:/Unix/home/OEM/jULIAN/src/instruments/linear/IRS.hpp
  • C:/Unix/home/OEM/jULIAN/src/instruments/linear/IRS.cpp