Class InterestRateSwap

Inheritance Relationships

Base Type

Class Documentation

class InterestRateSwap : public otyca::Security

Represents an interest rate swap contract.

The InterestRateSwap class models a fixed-for-floating interest rate swap. It provides methods to access the swap’s tenor and to calculate the implied fixed rate.

Public Functions

inline InterestRateSwap(int tenor)

Constructs an InterestRateSwap with a specified tenor.

Parameters:

tenor – Tenor (length in years) of the swap.

inline InterestRateSwap(int tenor, double bid, double ask)

Constructs an InterestRateSwap with specified tenor, bid, and ask rates.

Parameters:
  • tenor – Tenor (length in years) of the swap.

  • bid – Bid rate.

  • ask – Ask rate.

inline double rate()

Returns the implied fixed rate of the swap.

Returns:

Implied fixed rate (weighted mid of bid and ask).

inline int get_tenor() const

Returns the tenor (length) of the swap.

Returns:

Tenor in years.

inline void set_tenor(int tenor)

Sets the tenor (length) of the swap.

Parameters:

tenor – Tenor in years.

Friends

friend std::ostream &operator<<(std::ostream &out, const InterestRateSwap &point)

Outputs the InterestRateSwap to a stream.