The interpolation method to be used with the swaps rates. Valid values are L (linear) and S (Spline).

@DateRoll

The rule to be used when a calculated date lands on a non-business day. The @DateRollRule values are:

A

actual day is returned with no adjustment.

F

next business day is returned.

M

next business day is returned unless it is in a different month in which case the previous business day is returned.

P

preceding business day is returned.

MP

preceding business day is returned unless it is in a different month in which in case the next business day is returned.

@Holidays

a comma separated string containing the holiday (non-business) dates to be used in the calculation of the number of business days. You can use the aggregate function NBD to create an appropriately formatted string.

Return Type

float

Remarks

·To calculate the zero coupon rate for the supplied points on the ‘yield curve’ use the SWAPCURVE table-valued function.

·To interpolate the zero coupon or continuously compounded zero coupon rate from the discount factors use the DFINTERP aggregate function.

·Use the TENOR2DATE scalar function to convert abbreviations like 1M and 1Y to dates based on the spot date.

·Use the ED_FUT2DATE scalar function to convert futures contract codes to the correct settlement date based on the start date.

·Use the ED_FUT_CONV_ADJ_HL scalar function to convert the futures price to a convexity-adjusted interest rate.

Examples

In this example we will take a series of cash and swaps rates and convert them into zero coupon rates for the same date using linear interpolation. Note that we use the XLeratorDB TENOR2DATE function to calculate the actual maturity dates from the input.

SETNOCOUNTON

SELECT wct.TENOR2DATE(mDate,'2013-03-07','2013-03-11','')as mDate

,cRate

,iType

into #zc

FROM (

SELECT'1M', .0023,'C'UNIONALL

SELECT'3M', .0028,'C'UNIONALL

SELECT'6M', .0044,'C'UNIONALL

SELECT'1Y', .0031,'S'UNIONALL

SELECT'2Y', .0039,'S'UNIONALL

SELECT'3Y', .0054,'S'UNIONALL

SELECT'4Y', .0074,'S'UNIONALL

SELECT'5Y', .0100,'S'UNIONALL

SELECT'7Y', .0150,'S'UNIONALL

SELECT'10Y', .0207,'S'UNIONALL

SELECT'30Y', .0304,'S'

)n(mDate, cRate, iType)

SELECT k.mDate

,wct.ZEROCOUPON(

'SELECT * from #zc'--@InputData

,k.mDate --@vDate

,'ZC'--@ReturnValue

,'2013-03-07'--@StartDate

,2 --@Frequency

,'2013-03-11'--@SporDate

,2 --@CashBasis

,2 --@FuturesBasis

,0 --@SwapsBasis

,'L'--@InterpMethod

,'MP'--@DateRoll

,''--@Holidays

)as [Zero Coupon]

FROM (SELECT mDate FROM #zc)k(mDate)

DROPTABLE #zc

This produces the following result.

mDate Zero Coupon

---------- ----------------------

2013-04-11 0.00233199722782183

2013-06-11 0.00281783573019520

2013-09-11 0.00441592127318121

2014-03-11 0.00309301732585468

2015-03-11 0.00390391086884504

2016-03-11 0.00542991818661328

2017-03-13 0.00751102226468132

2018-03-12 0.0102986388496708

2020-03-11 0.0160514643629505

2023-03-13 0.0237723576078310

2043-03-11 0.0580036324845382

In this example we include the Eurodollar’s futures strip, starting with the June 2013 contract and we eliminate the 1-year swaps contract. Note that we use the XLeratorDB ED_FUT2DATE function to convert the futures contract code to the appropriate settlement date.