Convexity Adjustment 
Convexity adjustments are used in the calculation of forward interest rates, and are required only for interest rate instruments with floating components if the term of the reference interest rate is not the same as the term of the period to which the calculated rate is applied. An example of this type of transaction is the constant maturity swap. These are swaps that pay interest every six months for a ten-year bond in return for a fixed interest rate, for example.
Input parameters:
Today's date
Valuation date
Fixing date, date of interest fixing
Reference rate description
Unadjusted forward rate
Term of reference rate in days
The volatility to be used for the adjustment (can be left empty, in which case it is provided in the module (volatility of the reference rate for the period from valuation to fixing)).
The convexity and modified duration of a bond that has the same term as the reference rate have to be calculated in order to determine the adjustment.
First the term of the reference rate in years is determined.
Then a fictitious bond is generated, which has the same term, and year-round interest payments at the forward interest rate.
The difference quotient is then used to calculate the modified duration and convexity.
Finally, the following formula is used to calculate the adjustment.

where term is the term from the fixing date to the valuation date. The system reads the volatility from the database, but does not calculate a forward volatility.