Search code examples
financequantlib

Purpose of IborIndex tenor in VanillaSwap


What is the purpose of the IborIndex parameter in VanillaSwap class?

I have been doing some tests with the swapvaluation.cpp and it seems it does not make any difference in the valuation changing it from Euribor6M to, for example, Euribor2W.

I'm sure I'm missing something, but what I understand is that the schedule parametrization for the floating leg is done with floatingSchedule.

Thanks in advance


Solution

  • Not sure I'm right but I think I found the answer to my question.

    Looking at the source code of Euribor (https://github.com/lballabio/QuantLib/blob/master/ql/indexes/ibor/euribor.cpp) I found that the tenor is used to determine the day convention and the end of month rule used for fixings.

    BusinessDayConvention euriborConvention(const Period& p) {
            switch (p.units()) {
              case Days:
              case Weeks:
                return Following;
              case Months:
              case Years:
                return ModifiedFollowing;
              default:
                QL_FAIL("invalid time units");
            }
        }
    
    bool euriborEOM(const Period& p) {
            switch (p.units()) {
              case Days:
              case Weeks:
                return false;
              case Months:
              case Years:
                return true;
              default:
                QL_FAIL("invalid time units");
            }
        }