Logo

AMORTRATE

Updated 2024-02-13 20:39:43.617000

Syntax

SELECT [westclintech].[wct].[AMORTRATE] (
  <@Settlement, datetime,>
 ,<@Maturity, datetime,>
 ,<@Rate, float,>
 ,<@FaceAmount, float,>
 ,<@CleanPrice, float,>
 ,<@Redemption, float,>
 ,<@Frequency, float,>
 ,<@Basis, nvarchar(4000),>
 ,<@IssueDate, datetime,>
 ,<@FirstInterestDate, datetime,>
 ,<@LastInterestDate, datetime,>
 ,<@Holidays, nvarchar(max),>)

Description

Use the scalar function AMORTRATE to calculate the constant daily effective rate to be used in the amortization/accretion of bond (or loan) premium or discount.

The AMORTRATE value is used to calculate an adjustment to the daily interest accrual reflecting the appropriate amortization and is calculated in much the same way as the daily interest accrual. One way to think of this adjustment is as follows:

At = (Pt**r*a) – CtPt+1 = Pt + At

Where:At is the amortization amount at time t*.Pt is the principal amount at time t.*ra is the amortization rate.Ct Is daily coupon amount at time t. Due to various day-count conventions, the daily coupon amount may vary over the life of a financial instrument.

Notice that while A and P (and potentially C) vary over the term of the financial instrument, ra is constant.

Because ra is an adjustment to the coupon interest, the adjustment should only be applied on days when coupon interest is calculated. For some bonds, this means that there is no interest on the 31st of the month. For others, it might mean that interest is not accrued on Feb-29 or is only accrued on business days. Or, the last day of February might contain 2 or even 3 days of coupon interest. The AMORTRATE function makes the appropriate adjustment based in the day-count convention (also known as interest basis) supplied to the function.

To see a detailed amortization schedule using the AMORTRATE value, you can use the BONDAMORT table-valued function.

Arguments

@LastInterestDate

the last coupon date of the security prior to maturity date, if the last coupon period is an odd period. The period from the last interest date date until the maturity date defines the odd last interest period. All previous coupon dates are assumed to occur at regular periodic intervals as defined by @Frequency. @LastInterestDate is an expression of type datetime or of a type that can be implicitly converted to datetime.

@FaceAmount

the face (or notional) amount of the financial instrument. @FaceAmount is not necessarily the same as par value. For example, if you bought $1 million on US Treasury Bonds, the @FaceAmount would be $1 million. @FaceAmount is an expression of type float or of a type that can be implicitly converted to float.

@Basis

the day-count convention used in the calculation of the accrued coupon interest. @Basis is an expression of the character string data type category.

{"columns":[{"field":"@Basis","width":139},{"field":"Day count basis","width":396}],"rows":[{"@Basis":"0 or omitted","Day count basis":"US (NASD) 30/360"},{"@Basis":"1","Day count basis":"Actual/Actual"},{"@Basis":"2","Day count basis":"Actual/360"},{"@Basis":"3","Day count basis":"Actual/365"},{"@Basis":"4","Day count basis":"European 30/360"},{"@Basis":"5","Day count basis":"30/360 ISDA"},{"@Basis":"6","Day count basis":"NL/ACT"},{"@Basis":"7","Day count basis":"NL/365"},{"@Basis":"8","Day count basis":"NL/360"},{"@Basis":"9","Day count basis":"A/364"},{"@Basis":"10","Day count basis":"US (NASD) 30/360 non-end-of-month"},{"@Basis":"11","Day count basis":"Actual/Actual non-end-of-month"},{"@Basis":"12","Day count basis":"Actual/360 non-end-of-month"},{"@Basis":"13","Day count basis":"Actual/365 non-end-of-month"},{"@Basis":"14","Day count basis":"European 30/360 non-end-of-month"},{"@Basis":"15","Day count basis":"30/360 ISDA non-end-of-month"},{"@Basis":"16","Day count basis":"NL/ACT non-end-of-month"},{"@Basis":"17","Day count basis":"NL/365 non-end-of-month"},{"@Basis":"18","Day count basis":"NL/360 non-end-of-month"},{"@Basis":"19","Day count basis":"A/364 non-end-of-month"},{"@Basis":"20","Day count basis":"BUS/252"},{"@Basis":"21","Day count basis":"Actual/ISDA"},{"@Basis":"22","Day count basis":"Actual/ISMA"},{"@Basis":"23","Day count basis":"Actual/365L"},{"@Basis":"24","Day count basis":"Actual/AFB"},{"@Basis":"25","Day count basis":"30E+360"},{"@Basis":"30","Day count basis":"BUS/252 non-end-of-month"}]}

@Frequency

the number of coupon payments per year. For annual payments, @Frequency = 1; for semi-annual, @Frequency = 2; for quarterly, @Frequency = 4; for monthly, @Frequency = 12. @Frequency is an expression of type float or of a type that can be implicitly converted to float.

@FirstInterestDate

the first coupon date of the security. The period from the issue date until the first coupon date defines the odd first interest period. All subsequent coupon dates are assumed to occur at regular periodic intervals as defined by @Frequency in relation to the @LastInterestDate (if entered) or @Maturity. @FirstInterestDate is an expression of type datetime or of a type that can be implicitly converted to datetime.

@Rate

the coupon rate, as a decimal, for the financial instrument. @Rate is an expression of type float or of a type that can be implicitly converted to float.

@IssueDate

the issue date of the security; the date from which the security starts accruing interest. @IssueDate is an expression of type datetime or of a type that can be implicitly converted to datetime.

@CleanPrice

the initial value of the financial instrument, exclusive of any accrued interest. @CleanPrice should be expressed in relation to @FaceAmount. @CleanPrice is an expression of type float or of a type that can be implicitly converted to float.

@Settlement

the settlement date of the transaction. @Settlement is an expression of type datetime or of a type that can be implicitly converted to datetime.

@Maturity

the maturity date for the financial instrument. @Maturity is an expression of type datetime or of a type that can be implicitly converted to datetime.

@Redemption

the redemption value of the financial instrument expressed in relation to the @FaceAmount. @Redemption is an expression of type float or of a type that can be implicitly converted to float.

@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

Remarks

@Settlement cannot be NULL.

@Maturity cannot be NULL.

@Settlement must be less than @Maturity.

@FaceAmount, @CleanPrice, and @Redemption must all have the same sign.

If @Redemption is NULL, then @Redemption = @FaceAmount.

If @Frequency is NULL, then @Frequency = 2.

If @Basis is NULL, then @Basis = 0.

If @FirstInterestDate is NOT NULL, then @IssueDate cannot be NULL.

If @FirstInterestDate is NOT NULL, then @FirstInterestDate must be greater than @IssueDate.

If @LastInterestDate is NOT NULL, The @LastInterestDate must be less than @Maturity.

If @LastInterestDate is NOT NULL and @FirstInterestDate is NOT NULL, then @FirstInterestDate must be less than @LastInterestDate.

Examples

We buy 1,000,000 in face value of a bond on 2012-05-03 at a price of 999000. The bond matures on 2012-06-30 and accrues interest using the Actual/365 day-count method. The interest rate is 5%.

SELECT wct.AMORTRATE(   '2012-05-03', --Settlement

                        '2012-06-30', --Maturity

                        0.05,         --Rate

                        1000000.00,   --FaceAmount

                        999000.00,    --CleanPrice

                        NULL,         --Redemption

                        2,            --Frequency

                        '3',          --Basis

                        NULL,         --IssueDate

                        NULL,         --FirstInterestDate

                        NULL,         --LastInterestDate

                        NULL          --Holidays 

                    ) as [Amortization Rate];

This produces the following result.

{"columns":[{"field":"Amortization Rate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"Amortization Rate":"0.000154306279086793"}]}

We can create a bond amortization schedule using the BONDAMORT table-valued function and check to see that the daily accrual of the coupon plus the daily accretion of the discount divided by the beginning book value for each day equals our amortization rate and that the rate remains constant through to the maturity date.

SELECT amort_date,

       begin_book_val,

       dly_coup,

       dly_amort,

       end_book_val,

       CASE begin_book_val

           WHEN 0 THEN

               0

           ELSE

       (dly_amort + dly_coup) / begin_book_val

       END as dly_amort

FROM wct.BONDAMORT(   '2012-05-03', --Settlement

                      '2012-06-30', --Maturity

                      0.05,         --Rate

                      1000000.00,   --FaceAmount

                      999000.00,    --CleanPrice

                      NULL,         --Redemption

                      2,            --Frequency

                      '3',          --Basis

                      NULL,         --IssueDate

                      NULL,         --FirstInterestDate

                      NULL,         --LastInterestDate

                      NULL          --Holidays 

                  );

This produces the following result.

amort_date                      begin_book_val               dly_coup              dly_amort           end_book_val              dly_amort
----------------------- ---------------------- ---------------------- ---------------------- ---------------------- ----------------------
2012-05-03 00:00:00.000                      0                      0                      0                 999000                      0
2012-05-04 00:00:00.000                 999000       136.986301369863       17.1656714379787       999017.165671438   0.000154306279086929
2012-05-05 00:00:00.000       999017.165671438       136.986301369863       17.1683202086715       999034.333991647   0.000154306279086734
2012-05-06 00:00:00.000       999034.333991647       136.986301369863       17.1709693883313       999051.504961035   0.000154306279086784
2012-05-07 00:00:00.000       999051.504961035       136.986301369863       17.1736189768417       999068.678580012     0.0001543062790869
2012-05-08 00:00:00.000       999068.678580012       136.986301369863       17.1762689739699       999085.854848986   0.000154306279086785
2012-05-09 00:00:00.000       999085.854848986       136.986301369863       17.1789193799486       999103.033768366    0.00015430627908661
2012-05-10 00:00:00.000       999103.033768366       136.986301369863       17.1815701953601       999120.215338561   0.000154306279086893
2012-05-11 00:00:00.000       999120.215338561       136.986301369863       17.1842214195058       999137.399559981   0.000154306279086873
2012-05-12 00:00:00.000       999137.399559981       136.986301369863       17.1868730526185       999154.586433033   0.000154306279086719
2012-05-13 00:00:00.000       999154.586433033       136.986301369863       17.1895250950474       999171.775958128   0.000154306279086719
2012-05-14 00:00:00.000       999171.775958128       136.986301369863       17.1921775469091       999188.968135675   0.000154306279086924
2012-05-15 00:00:00.000       999188.968135675       136.986301369863       17.1948304076213       999206.162966083   0.000154306279086689
2012-05-16 00:00:00.000       999206.162966083       136.986301369863       17.1974836781155       999223.360449761   0.000154306279086884
2012-05-17 00:00:00.000       999223.360449761       136.986301369863       17.2001373575768       999240.560587119   0.000154306279086629
2012-05-18 00:00:00.000       999240.560587119       136.986301369863       17.2027914470527       999257.763378566   0.000154306279086909
2012-05-19 00:00:00.000       999257.763378566       136.986301369863       17.2054459456122       999274.968824511   0.000154306279086731
2012-05-20 00:00:00.000       999274.968824511       136.986301369863       17.2081008539535       999292.176925365   0.000154306279086728
2012-05-21 00:00:00.000       999292.176925365       136.986301369863       17.2107561720768       999309.387681537   0.000154306279086839
2012-05-22 00:00:00.000       999309.387681537       136.986301369863       17.2134118998656       999326.601093437   0.000154306279086882
2012-05-23 00:00:00.000       999326.601093437       136.986301369863       17.2160680373199       999343.817161474   0.000154306279086796
2012-05-24 00:00:00.000       999343.817161474       136.986301369863       17.2187245846726       999361.035886059   0.000154306279086749
2012-05-25 00:00:00.000       999361.035886059       136.986301369863         17.22138154204       999378.257267601   0.000154306279086795
2012-05-26 00:00:00.000       999378.257267601       136.986301369863       17.2240389093058        999395.48130651   0.000154306279086755
2012-05-27 00:00:00.000        999395.48130651       136.986301369863       17.2266966867028       999412.708003197   0.000154306279086797
2012-05-28 00:00:00.000       999412.708003197       136.986301369863       17.2293548741145       999429.937358071   0.000154306279086742
2012-05-29 00:00:00.000       999429.937358071       136.986301369863       17.2320134717738       999447.169371543   0.000154306279086759
2012-05-30 00:00:00.000       999447.169371543       136.986301369863       17.2346724796807       999464.404044023   0.000154306279086786
2012-05-31 00:00:00.000       999464.404044023       136.986301369863       17.2373318979517       999481.641375921   0.000154306279086876
2012-06-01 00:00:00.000       999481.641375921       136.986301369863       17.2399917263538       999498.881367647   0.000154306279086731
2012-06-02 00:00:00.000       999498.881367647       136.986301369863       17.2426519654691       999516.124019612   0.000154306279086872
2012-06-03 00:00:00.000       999516.124019612       136.986301369863       17.2453126148321       999533.369332227   0.000154306279086768
2012-06-04 00:00:00.000       999533.369332227       136.986301369863       17.2479736747919       999550.617305902   0.000154306279086707
2012-06-05 00:00:00.000       999550.617305902       136.986301369863       17.2506351454649       999567.867941048    0.00015430627908674
2012-06-06 00:00:00.000       999567.867941048       136.986301369863       17.2532970269676       999585.121238075   0.000154306279086922
2012-06-07 00:00:00.000       999585.121238075       136.986301369863       17.2559593189508       999602.377197393   0.000154306279086839
2012-06-08 00:00:00.000       999602.377197393       136.986301369863       17.2586220216472       999619.635819415    0.00015430627908666
2012-06-09 00:00:00.000       999619.635819415       136.986301369863       17.2612851355225       999636.897104551   0.000154306279086789
2012-06-10 00:00:00.000       999636.897104551       136.986301369863       17.2639486602275       999654.161053211   0.000154306279086813
2012-06-11 00:00:00.000       999654.161053211       136.986301369863       17.2666125958785       999671.427665807   0.000154306279086784
2012-06-12 00:00:00.000       999671.427665807       136.986301369863       17.2692769427085       999688.696942749   0.000154306279086872
2012-06-13 00:00:00.000       999688.696942749       136.986301369863       17.2719417003682        999705.96888445   0.000154306279086664
2012-06-14 00:00:00.000        999705.96888445       136.986301369863        17.274606869556       999723.243491319   0.000154306279086795
2012-06-15 00:00:00.000       999723.243491319       136.986301369863       17.2772724499227       999740.520763769   0.000154306279086853
2012-06-16 00:00:00.000       999740.520763769       136.986301369863       17.2799384414684       999757.800702211   0.000154306279086774
2012-06-17 00:00:00.000       999757.800702211       136.986301369863       17.2826048445422       999775.083307055   0.000154306279086845
2012-06-18 00:00:00.000       999775.083307055       136.986301369863       17.2852716589114       999792.368578714   0.000154306279086767
2012-06-19 00:00:00.000       999792.368578714       136.986301369863       17.2879388848087       999809.656517599   0.000154306279086712
2012-06-20 00:00:00.000       999809.656517599       136.986301369863        17.290606522467       999826.947124121   0.000154306279086848
2012-06-21 00:00:00.000       999826.947124121       136.986301369863        17.293274571537       999844.240398693   0.000154306279086762
2012-06-22 00:00:00.000       999844.240398693       136.986301369863       17.2959430324845       999861.536341726   0.000154306279086857
2012-06-23 00:00:00.000       999861.536341726       136.986301369863       17.2986119049601        999878.83495363    0.00015430627908672
2012-06-24 00:00:00.000        999878.83495363       136.986301369863       17.3012811894296        999896.13623482   0.000154306279086753
2012-06-25 00:00:00.000        999896.13623482       136.986301369863       17.3039508858928       999913.440185706   0.000154306279086893
2012-06-26 00:00:00.000       999913.440185706       136.986301369863       17.3066209938843         999930.7468067   0.000154306279086609
2012-06-27 00:00:00.000         999930.7468067       136.986301369863       17.3092915144516       999948.056098214   0.000154306279086888
2012-06-28 00:00:00.000       999948.056098214       136.986301369863       17.3119624467799       999965.368060661   0.000154306279086849
2012-06-29 00:00:00.000       999965.368060661       136.986301369863       17.3146337912185       999982.682694452   0.000154306279086779
2012-06-30 00:00:00.000       999982.682694452       136.986301369863       17.3173055478837                1000000    0.00015430627908673

In this example we will change the basis to 0, to reflect the US 30/360 day-count convention.

SELECT wct.AMORTRATE(   '2012-05-03', --Settlement

                        '2012-06-30', --Maturity

                        0.05,         --Rate

                        1000000.00,   --FaceAmount

                        999000.00,    --CleanPrice

                        NULL,         --Redemption

                        2,            --Frequency

                        '0',          --Basis

                        NULL,         --IssueDate

                        NULL,         --FirstInterestDate

                        NULL,         --LastInterestDate

                        NULL          --Holidays 

                    ) as [Amortization Rate];

This produces the following result.

{"columns":[{"field":"Amortization Rate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"Amortization Rate":"0.000156512494013327"}]}

Let’s create the amortization table

SELECT amort_date,

       begin_book_val,

       dly_coup,

       dly_amort,

       end_book_val,

       CASE begin_book_val

           WHEN 0 THEN

               0

           ELSE

       (dly_coup + dly_amort) / begin_book_val

       END as amort_rate

FROM wct.BONDAMORT(   '2012-05-03', --Settlement

                      '2012-06-30', --Maturity

                      0.05,         --Rate

                      1000000.00,   --FaceAmount

                      999000.00,    --CleanPrice

                      NULL,         --Redemption

                      2,            --Frequency

                      '0',          --Basis

                      NULL,         --IssueDate

                      NULL,         --FirstInterestDate

                      NULL,         --LastInterestDate

                      NULL          --Holidays 

                  );

This produces the following result.

{"columns":[{"field":"amort_date","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":72},{"field":"begin_book_val","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":95},{"field":"dly_coup","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":60},{"field":"dly_amort","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":65},{"field":"end_book_val","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":84},{"field":"amort_rate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":97}],"rows":[{"amort_date":"3-May-12","begin_book_val":"0.0000","dly_coup":"0.0000","dly_amort":"0.0000","end_book_val":"999000.0000","amort_rate":"0.000000000000"},{"amort_date":"4-May-12","begin_book_val":"999000.0000","dly_coup":"138.8889","dly_amort":"17.4671","end_book_val":"999017.4671","amort_rate":"0.000156512494"},{"amort_date":"5-May-12","begin_book_val":"999017.4671","dly_coup":"138.8889","dly_amort":"17.4698","end_book_val":"999034.9369","amort_rate":"0.000156512494"},{"amort_date":"6-May-12","begin_book_val":"999034.9369","dly_coup":"138.8889","dly_amort":"17.4726","end_book_val":"999052.4095","amort_rate":"0.000156512494"},{"amort_date":"7-May-12","begin_book_val":"999052.4095","dly_coup":"138.8889","dly_amort":"17.4753","end_book_val":"999069.8848","amort_rate":"0.000156512494"},{"amort_date":"8-May-12","begin_book_val":"999069.8848","dly_coup":"138.8889","dly_amort":"17.4780","end_book_val":"999087.3628","amort_rate":"0.000156512494"},{"amort_date":"9-May-12","begin_book_val":"999087.3628","dly_coup":"138.8889","dly_amort":"17.4808","end_book_val":"999104.8436","amort_rate":"0.000156512494"},{"amort_date":"10-May-12","begin_book_val":"999104.8436","dly_coup":"138.8889","dly_amort":"17.4835","end_book_val":"999122.3271","amort_rate":"0.000156512494"},{"amort_date":"11-May-12","begin_book_val":"999122.3271","dly_coup":"138.8889","dly_amort":"17.4862","end_book_val":"999139.8133","amort_rate":"0.000156512494"},{"amort_date":"12-May-12","begin_book_val":"999139.8133","dly_coup":"138.8889","dly_amort":"17.4890","end_book_val":"999157.3023","amort_rate":"0.000156512494"},{"amort_date":"13-May-12","begin_book_val":"999157.3023","dly_coup":"138.8889","dly_amort":"17.4917","end_book_val":"999174.7940","amort_rate":"0.000156512494"},{"amort_date":"14-May-12","begin_book_val":"999174.7940","dly_coup":"138.8889","dly_amort":"17.4945","end_book_val":"999192.2884","amort_rate":"0.000156512494"},{"amort_date":"15-May-12","begin_book_val":"999192.2884","dly_coup":"138.8889","dly_amort":"17.4972","end_book_val":"999209.7856","amort_rate":"0.000156512494"},{"amort_date":"16-May-12","begin_book_val":"999209.7856","dly_coup":"138.8889","dly_amort":"17.4999","end_book_val":"999227.2856","amort_rate":"0.000156512494"},{"amort_date":"17-May-12","begin_book_val":"999227.2856","dly_coup":"138.8889","dly_amort":"17.5027","end_book_val":"999244.7882","amort_rate":"0.000156512494"},{"amort_date":"18-May-12","begin_book_val":"999244.7882","dly_coup":"138.8889","dly_amort":"17.5054","end_book_val":"999262.2936","amort_rate":"0.000156512494"},{"amort_date":"19-May-12","begin_book_val":"999262.2936","dly_coup":"138.8889","dly_amort":"17.5081","end_book_val":"999279.8018","amort_rate":"0.000156512494"},{"amort_date":"20-May-12","begin_book_val":"999279.8018","dly_coup":"138.8889","dly_amort":"17.5109","end_book_val":"999297.3127","amort_rate":"0.000156512494"},{"amort_date":"21-May-12","begin_book_val":"999297.3127","dly_coup":"138.8889","dly_amort":"17.5136","end_book_val":"999314.8263","amort_rate":"0.000156512494"},{"amort_date":"22-May-12","begin_book_val":"999314.8263","dly_coup":"138.8889","dly_amort":"17.5164","end_book_val":"999332.3427","amort_rate":"0.000156512494"},{"amort_date":"23-May-12","begin_book_val":"999332.3427","dly_coup":"138.8889","dly_amort":"17.5191","end_book_val":"999349.8618","amort_rate":"0.000156512494"},{"amort_date":"24-May-12","begin_book_val":"999349.8618","dly_coup":"138.8889","dly_amort":"17.5219","end_book_val":"999367.3836","amort_rate":"0.000156512494"},{"amort_date":"25-May-12","begin_book_val":"999367.3836","dly_coup":"138.8889","dly_amort":"17.5246","end_book_val":"999384.9082","amort_rate":"0.000156512494"},{"amort_date":"26-May-12","begin_book_val":"999384.9082","dly_coup":"138.8889","dly_amort":"17.5273","end_book_val":"999402.4355","amort_rate":"0.000156512494"},{"amort_date":"27-May-12","begin_book_val":"999402.4355","dly_coup":"138.8889","dly_amort":"17.5301","end_book_val":"999419.9656","amort_rate":"0.000156512494"},{"amort_date":"28-May-12","begin_book_val":"999419.9656","dly_coup":"138.8889","dly_amort":"17.5328","end_book_val":"999437.4984","amort_rate":"0.000156512494"},{"amort_date":"29-May-12","begin_book_val":"999437.4984","dly_coup":"138.8889","dly_amort":"17.5356","end_book_val":"999455.0340","amort_rate":"0.000156512494"},{"amort_date":"30-May-12","begin_book_val":"999455.0340","dly_coup":"138.8889","dly_amort":"17.5383","end_book_val":"999472.5723","amort_rate":"0.000156512494"},{"amort_date":"31-May-12","begin_book_val":"999472.5723","dly_coup":"0.0000","dly_amort":"0.0000","end_book_val":"999472.5723","amort_rate":"0.000000000000"},{"amort_date":"1-Jun-12","begin_book_val":"999472.5723","dly_coup":"138.8889","dly_amort":"17.5411","end_book_val":"999490.1134","amort_rate":"0.000156512494"},{"amort_date":"2-Jun-12","begin_book_val":"999490.1134","dly_coup":"138.8889","dly_amort":"17.5438","end_book_val":"999507.6572","amort_rate":"0.000156512494"},{"amort_date":"3-Jun-12","begin_book_val":"999507.6572","dly_coup":"138.8889","dly_amort":"17.5465","end_book_val":"999525.2037","amort_rate":"0.000156512494"},{"amort_date":"4-Jun-12","begin_book_val":"999525.2037","dly_coup":"138.8889","dly_amort":"17.5493","end_book_val":"999542.7530","amort_rate":"0.000156512494"},{"amort_date":"5-Jun-12","begin_book_val":"999542.7530","dly_coup":"138.8889","dly_amort":"17.5520","end_book_val":"999560.3051","amort_rate":"0.000156512494"},{"amort_date":"6-Jun-12","begin_book_val":"999560.3051","dly_coup":"138.8889","dly_amort":"17.5548","end_book_val":"999577.8599","amort_rate":"0.000156512494"},{"amort_date":"7-Jun-12","begin_book_val":"999577.8599","dly_coup":"138.8889","dly_amort":"17.5575","end_book_val":"999595.4174","amort_rate":"0.000156512494"},{"amort_date":"8-Jun-12","begin_book_val":"999595.4174","dly_coup":"138.8889","dly_amort":"17.5603","end_book_val":"999612.9777","amort_rate":"0.000156512494"},{"amort_date":"9-Jun-12","begin_book_val":"999612.9777","dly_coup":"138.8889","dly_amort":"17.5630","end_book_val":"999630.5407","amort_rate":"0.000156512494"},{"amort_date":"10-Jun-12","begin_book_val":"999630.5407","dly_coup":"138.8889","dly_amort":"17.5658","end_book_val":"999648.1065","amort_rate":"0.000156512494"},{"amort_date":"11-Jun-12","begin_book_val":"999648.1065","dly_coup":"138.8889","dly_amort":"17.5685","end_book_val":"999665.6750","amort_rate":"0.000156512494"},{"amort_date":"12-Jun-12","begin_book_val":"999665.6750","dly_coup":"138.8889","dly_amort":"17.5713","end_book_val":"999683.2463","amort_rate":"0.000156512494"},{"amort_date":"13-Jun-12","begin_book_val":"999683.2463","dly_coup":"138.8889","dly_amort":"17.5740","end_book_val":"999700.8203","amort_rate":"0.000156512494"},{"amort_date":"14-Jun-12","begin_book_val":"999700.8203","dly_coup":"138.8889","dly_amort":"17.5768","end_book_val":"999718.3971","amort_rate":"0.000156512494"},{"amort_date":"15-Jun-12","begin_book_val":"999718.3971","dly_coup":"138.8889","dly_amort":"17.5795","end_book_val":"999735.9766","amort_rate":"0.000156512494"},{"amort_date":"16-Jun-12","begin_book_val":"999735.9766","dly_coup":"138.8889","dly_amort":"17.5823","end_book_val":"999753.5589","amort_rate":"0.000156512494"},{"amort_date":"17-Jun-12","begin_book_val":"999753.5589","dly_coup":"138.8889","dly_amort":"17.5850","end_book_val":"999771.1439","amort_rate":"0.000156512494"},{"amort_date":"18-Jun-12","begin_book_val":"999771.1439","dly_coup":"138.8889","dly_amort":"17.5878","end_book_val":"999788.7317","amort_rate":"0.000156512494"},{"amort_date":"19-Jun-12","begin_book_val":"999788.7317","dly_coup":"138.8889","dly_amort":"17.5905","end_book_val":"999806.3223","amort_rate":"0.000156512494"},{"amort_date":"20-Jun-12","begin_book_val":"999806.3223","dly_coup":"138.8889","dly_amort":"17.5933","end_book_val":"999823.9156","amort_rate":"0.000156512494"},{"amort_date":"21-Jun-12","begin_book_val":"999823.9156","dly_coup":"138.8889","dly_amort":"17.5960","end_book_val":"999841.5116","amort_rate":"0.000156512494"},{"amort_date":"22-Jun-12","begin_book_val":"999841.5116","dly_coup":"138.8889","dly_amort":"17.5988","end_book_val":"999859.1104","amort_rate":"0.000156512494"},{"amort_date":"23-Jun-12","begin_book_val":"999859.1104","dly_coup":"138.8889","dly_amort":"17.6016","end_book_val":"999876.7120","amort_rate":"0.000156512494"},{"amort_date":"24-Jun-12","begin_book_val":"999876.7120","dly_coup":"138.8889","dly_amort":"17.6043","end_book_val":"999894.3163","amort_rate":"0.000156512494"},{"amort_date":"25-Jun-12","begin_book_val":"999894.3163","dly_coup":"138.8889","dly_amort":"17.6071","end_book_val":"999911.9233","amort_rate":"0.000156512494"},{"amort_date":"26-Jun-12","begin_book_val":"999911.9233","dly_coup":"138.8889","dly_amort":"17.6098","end_book_val":"999929.5332","amort_rate":"0.000156512494"},{"amort_date":"27-Jun-12","begin_book_val":"999929.5332","dly_coup":"138.8889","dly_amort":"17.6126","end_book_val":"999947.1457","amort_rate":"0.000156512494"},{"amort_date":"28-Jun-12","begin_book_val":"999947.1457","dly_coup":"138.8889","dly_amort":"17.6153","end_book_val":"999964.7611","amort_rate":"0.000156512494"},{"amort_date":"29-Jun-12","begin_book_val":"999964.7611","dly_coup":"138.8889","dly_amort":"17.6181","end_book_val":"999982.3792","amort_rate":"0.000156512494"},{"amort_date":"30-Jun-12","begin_book_val":"999982.3792","dly_coup":"138.8889","dly_amort":"17.6208","end_book_val":"1000000.0000","amort_rate":"0.000156512494"}]}

Notice the row for the 31-May-12. There is no daily coupon accrual, reflecting the market convention for this day-count convention. Since there is no daily coupon accrual, there is no need to adjust the interest for this day and there is no daily amortization. Let’s look at what happens with a US 30/360 bond over a February month end.

SELECT wct.AMORTRATE(   '2012-02-15', --Settlement

                        '2012-03-15', --Maturity

                        0.05,         --Rate

                        1000000.00,   --FaceAmount

                        999000.00,    --CleanPrice

                        NULL,         --Redemption

                        2,            --Frequency

                        '0',          --Basis

                        NULL,         --IssueDate

                        NULL,         --FirstInterestDate

                        NULL,         --LastInterestDate

                        NULL          --Holidays 

                    ) as [Amortization Rate];

This produces the following result.

{"columns":[{"field":"Amortization Rate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"Amortization Rate":"0.000172311323878642"}]}

This creates the amortization table

SELECT amort_date,

       begin_book_val,

       dly_coup,

       dly_amort,

       end_book_val,

       CASE begin_book_val

           WHEN 0 THEN

               0

           ELSE

       (dly_coup + dly_amort) / begin_book_val

       END as amort_rate

FROM wct.BONDAMORT(   '2012-02-15', --Settlement

                      '2012-03-15', --Maturity

                      0.05,         --Rate

                      1000000.00,   --FaceAmount

                      999000.00,    --CleanPrice

                      NULL,         --Redemption

                      2,            --Frequency

                      '0',          --Basis

                      NULL,         --IssueDate

                      NULL,         --FirstInterestDate

                      NULL,         --LastInterestDate

                      NULL          --Holidays 

                  );

This produces the following result.

{"columns":[{"field":"amort_date","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":72},{"field":"begin_book_val","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":95},{"field":"dly_coup","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":60},{"field":"dly_amort","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":65},{"field":"end_book_val","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":84},{"field":"amort_rate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":97}],"rows":[{"amort_date":"15-Feb-12","begin_book_val":"0.00000","dly_coup":"0.00000","dly_amort":"0.00000","end_book_val":"999000.00000","amort_rate":"0.000000000000"},{"amort_date":"16-Feb-12","begin_book_val":"999000.0000","dly_coup":"138.8889","dly_amort":"33.2501","end_book_val":"999033.2501","amort_rate":"0.000172311324"},{"amort_date":"17-Feb-12","begin_book_val":"999033.2501","dly_coup":"138.8889","dly_amort":"33.2559","end_book_val":"999066.5060","amort_rate":"0.000172311324"},{"amort_date":"18-Feb-12","begin_book_val":"999066.5060","dly_coup":"138.8889","dly_amort":"33.2616","end_book_val":"999099.7676","amort_rate":"0.000172311324"},{"amort_date":"19-Feb-12","begin_book_val":"999099.7676","dly_coup":"138.8889","dly_amort":"33.2673","end_book_val":"999133.0349","amort_rate":"0.000172311324"},{"amort_date":"20-Feb-12","begin_book_val":"999133.0349","dly_coup":"138.8889","dly_amort":"33.2730","end_book_val":"999166.3079","amort_rate":"0.000172311324"},{"amort_date":"21-Feb-12","begin_book_val":"999166.3079","dly_coup":"138.8889","dly_amort":"33.2788","end_book_val":"999199.5867","amort_rate":"0.000172311324"},{"amort_date":"22-Feb-12","begin_book_val":"999199.5867","dly_coup":"138.8889","dly_amort":"33.2845","end_book_val":"999232.8712","amort_rate":"0.000172311324"},{"amort_date":"23-Feb-12","begin_book_val":"999232.8712","dly_coup":"138.8889","dly_amort":"33.2903","end_book_val":"999266.1615","amort_rate":"0.000172311324"},{"amort_date":"24-Feb-12","begin_book_val":"999266.1615","dly_coup":"138.8889","dly_amort":"33.2960","end_book_val":"999299.4575","amort_rate":"0.000172311324"},{"amort_date":"25-Feb-12","begin_book_val":"999299.4575","dly_coup":"138.8889","dly_amort":"33.3017","end_book_val":"999332.7592","amort_rate":"0.000172311324"},{"amort_date":"26-Feb-12","begin_book_val":"999332.7592","dly_coup":"138.8889","dly_amort":"33.3075","end_book_val":"999366.0666","amort_rate":"0.000172311324"},{"amort_date":"27-Feb-12","begin_book_val":"999366.0666","dly_coup":"138.8889","dly_amort":"33.3132","end_book_val":"999399.3798","amort_rate":"0.000172311324"},{"amort_date":"28-Feb-12","begin_book_val":"999399.3798","dly_coup":"138.8889","dly_amort":"33.3189","end_book_val":"999432.6988","amort_rate":"0.000172311324"},{"amort_date":"29-Feb-12","begin_book_val":"999432.6988","dly_coup":"277.7778","dly_amort":"66.6551","end_book_val":"999499.3539","amort_rate":"0.000344628393"},{"amort_date":"1-Mar-12","begin_book_val":"999499.3539","dly_coup":"138.8889","dly_amort":"33.3362","end_book_val":"999532.6901","amort_rate":"0.000172311324"},{"amort_date":"2-Mar-12","begin_book_val":"999532.6901","dly_coup":"138.8889","dly_amort":"33.3419","end_book_val":"999566.0320","amort_rate":"0.000172311324"},{"amort_date":"3-Mar-12","begin_book_val":"999566.0320","dly_coup":"138.8889","dly_amort":"33.3477","end_book_val":"999599.3796","amort_rate":"0.000172311324"},{"amort_date":"4-Mar-12","begin_book_val":"999599.3796","dly_coup":"138.8889","dly_amort":"33.3534","end_book_val":"999632.7330","amort_rate":"0.000172311324"},{"amort_date":"5-Mar-12","begin_book_val":"999632.7330","dly_coup":"138.8889","dly_amort":"33.3592","end_book_val":"999666.0922","amort_rate":"0.000172311324"},{"amort_date":"6-Mar-12","begin_book_val":"999666.0922","dly_coup":"138.8889","dly_amort":"33.3649","end_book_val":"999699.4571","amort_rate":"0.000172311324"},{"amort_date":"7-Mar-12","begin_book_val":"999699.4571","dly_coup":"138.8889","dly_amort":"33.3706","end_book_val":"999732.8277","amort_rate":"0.000172311324"},{"amort_date":"8-Mar-12","begin_book_val":"999732.8277","dly_coup":"138.8889","dly_amort":"33.3764","end_book_val":"999766.2041","amort_rate":"0.000172311324"},{"amort_date":"9-Mar-12","begin_book_val":"999766.2041","dly_coup":"138.8889","dly_amort":"33.3821","end_book_val":"999799.5863","amort_rate":"0.000172311324"},{"amort_date":"10-Mar-12","begin_book_val":"999799.5863","dly_coup":"138.8889","dly_amort":"33.3879","end_book_val":"999832.9742","amort_rate":"0.000172311324"},{"amort_date":"11-Mar-12","begin_book_val":"999832.9742","dly_coup":"138.8889","dly_amort":"33.3937","end_book_val":"999866.3678","amort_rate":"0.000172311324"},{"amort_date":"12-Mar-12","begin_book_val":"999866.3678","dly_coup":"138.8889","dly_amort":"33.3994","end_book_val":"999899.7672","amort_rate":"0.000172311324"},{"amort_date":"13-Mar-12","begin_book_val":"999899.7672","dly_coup":"138.8889","dly_amort":"33.4052","end_book_val":"999933.1724","amort_rate":"0.000172311324"},{"amort_date":"14-Mar-12","begin_book_val":"999933.1724","dly_coup":"138.8889","dly_amort":"33.4109","end_book_val":"999966.5833","amort_rate":"0.000172311324"},{"amort_date":"15-Mar-12","begin_book_val":"999966.5833","dly_coup":"138.8889","dly_amort":"33.4167","end_book_val":"1000000.0000","amort_rate":"0.000172311324"}]}

Notice that for 29-Feb-12 the daily coupon is actually two days of coupon interest (again, reflecting market practice). Thus, the daily amortization also needs to reflect two days of amortization, which AMORTRATE has factored into the calculation.

Here’s an example for NL/365 in which Feb-29 is not included in the date calculations (NL meaning No Leap year).

SELECT wct.AMORTRATE(   '2012-02-15', --Settlement

                        '2012-03-15', --Maturity

                        0.05,         --Rate

                        1000000.00,   --FaceAmount

                        999000.00,    --CleanPrice

                        NULL,         --Redemption

                        2,            --Frequency

                        '7',          --Basis

                        NULL,         --IssueDate

                        NULL,         --FirstInterestDate

                        NULL,         --LastInterestDate

                        NULL          --Holidays 

                    ) as [Amortization Rate];

This produces the following result.

{"columns":[{"field":"Amortization Rate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"Amortization Rate":"0.000172790137261541"}]}

This produces the amortization table

SELECT amort_date,

       begin_book_val,

       dly_coup,

       dly_amort,

       end_book_val,

       CASE begin_book_val

           WHEN 0 THEN

               0

           ELSE

       (dly_coup + dly_amort) / begin_book_val

       END as amort_rate

FROM wct.BONDAMORT(   '2012-02-15', --Settlement

                      '2012-03-15', --Maturity

                      0.05,         --Rate

                      1000000.00,   --FaceAmount

                      999000.00,    --CleanPrice

                      NULL,         --Redemption

                      2,            --Frequency

                      '7',          --Basis

                      NULL,         --IssueDate

                      NULL,         --FirstInterestDate

                      NULL,         --LastInterestDate

                      NULL          --Holidays 

                  );

This produces the following result.

{"columns":[{"field":"amort_date","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":71},{"field":"begin_book_val","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":95},{"field":"dly_coup","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":55},{"field":"dly_amort","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":61},{"field":"end_book_val","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":83},{"field":"amort_rate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":88}],"rows":[{"amort_date":"15-Feb-12","begin_book_val":"0.00000","dly_coup":"0.00000","dly_amort":"0.00000","end_book_val":"999000.00000","amort_rate":"0.000000000000"},{"amort_date":"16-Feb-12","begin_book_val":"999000.0000","dly_coup":"136.9863","dly_amort":"35.6310","end_book_val":"999035.6310","amort_rate":"0.000172790137"},{"amort_date":"17-Feb-12","begin_book_val":"999035.6310","dly_coup":"136.9863","dly_amort":"35.6372","end_book_val":"999071.2682","amort_rate":"0.000172790137"},{"amort_date":"18-Feb-12","begin_book_val":"999071.2682","dly_coup":"136.9863","dly_amort":"35.6434","end_book_val":"999106.9116","amort_rate":"0.000172790137"},{"amort_date":"19-Feb-12","begin_book_val":"999106.9116","dly_coup":"136.9863","dly_amort":"35.6495","end_book_val":"999142.5611","amort_rate":"0.000172790137"},{"amort_date":"20-Feb-12","begin_book_val":"999142.5611","dly_coup":"136.9863","dly_amort":"35.6557","end_book_val":"999178.2168","amort_rate":"0.000172790137"},{"amort_date":"21-Feb-12","begin_book_val":"999178.2168","dly_coup":"136.9863","dly_amort":"35.6618","end_book_val":"999213.8786","amort_rate":"0.000172790137"},{"amort_date":"22-Feb-12","begin_book_val":"999213.8786","dly_coup":"136.9863","dly_amort":"35.6680","end_book_val":"999249.5466","amort_rate":"0.000172790137"},{"amort_date":"23-Feb-12","begin_book_val":"999249.5466","dly_coup":"136.9863","dly_amort":"35.6742","end_book_val":"999285.2208","amort_rate":"0.000172790137"},{"amort_date":"24-Feb-12","begin_book_val":"999285.2208","dly_coup":"136.9863","dly_amort":"35.6803","end_book_val":"999320.9011","amort_rate":"0.000172790137"},{"amort_date":"25-Feb-12","begin_book_val":"999320.9011","dly_coup":"136.9863","dly_amort":"35.6865","end_book_val":"999356.5876","amort_rate":"0.000172790137"},{"amort_date":"26-Feb-12","begin_book_val":"999356.5876","dly_coup":"136.9863","dly_amort":"35.6927","end_book_val":"999392.2803","amort_rate":"0.000172790137"},{"amort_date":"27-Feb-12","begin_book_val":"999392.2803","dly_coup":"136.9863","dly_amort":"35.6988","end_book_val":"999427.9791","amort_rate":"0.000172790137"},{"amort_date":"28-Feb-12","begin_book_val":"999427.9791","dly_coup":"136.9863","dly_amort":"35.7050","end_book_val":"999463.6841","amort_rate":"0.000172790137"},{"amort_date":"29-Feb-12","begin_book_val":"999463.6841","dly_coup":"0.0000","dly_amort":"0.0000","end_book_val":"999463.6841","amort_rate":"0.000000000000"},{"amort_date":"1-Mar-12","begin_book_val":"999463.6841","dly_coup":"136.9863","dly_amort":"35.7112","end_book_val":"999499.3953","amort_rate":"0.000172790137"},{"amort_date":"2-Mar-12","begin_book_val":"999499.3953","dly_coup":"136.9863","dly_amort":"35.7173","end_book_val":"999535.1126","amort_rate":"0.000172790137"},{"amort_date":"3-Mar-12","begin_book_val":"999535.1126","dly_coup":"136.9863","dly_amort":"35.7235","end_book_val":"999570.8361","amort_rate":"0.000172790137"},{"amort_date":"4-Mar-12","begin_book_val":"999570.8361","dly_coup":"136.9863","dly_amort":"35.7297","end_book_val":"999606.5658","amort_rate":"0.000172790137"},{"amort_date":"5-Mar-12","begin_book_val":"999606.5658","dly_coup":"136.9863","dly_amort":"35.7359","end_book_val":"999642.3017","amort_rate":"0.000172790137"},{"amort_date":"6-Mar-12","begin_book_val":"999642.3017","dly_coup":"136.9863","dly_amort":"35.7420","end_book_val":"999678.0437","amort_rate":"0.000172790137"},{"amort_date":"7-Mar-12","begin_book_val":"999678.0437","dly_coup":"136.9863","dly_amort":"35.7482","end_book_val":"999713.7919","amort_rate":"0.000172790137"},{"amort_date":"8-Mar-12","begin_book_val":"999713.7919","dly_coup":"136.9863","dly_amort":"35.7544","end_book_val":"999749.5463","amort_rate":"0.000172790137"},{"amort_date":"9-Mar-12","begin_book_val":"999749.5463","dly_coup":"136.9863","dly_amort":"35.7606","end_book_val":"999785.3068","amort_rate":"0.000172790137"},{"amort_date":"10-Mar-12","begin_book_val":"999785.3068","dly_coup":"136.9863","dly_amort":"35.7667","end_book_val":"999821.0736","amort_rate":"0.000172790137"},{"amort_date":"11-Mar-12","begin_book_val":"999821.0736","dly_coup":"136.9863","dly_amort":"35.7729","end_book_val":"999856.8465","amort_rate":"0.000172790137"},{"amort_date":"12-Mar-12","begin_book_val":"999856.8465","dly_coup":"136.9863","dly_amort":"35.7791","end_book_val":"999892.6256","amort_rate":"0.000172790137"},{"amort_date":"13-Mar-12","begin_book_val":"999892.6256","dly_coup":"136.9863","dly_amort":"35.7853","end_book_val":"999928.4109","amort_rate":"0.000172790137"},{"amort_date":"14-Mar-12","begin_book_val":"999928.4109","dly_coup":"136.9863","dly_amort":"35.7915","end_book_val":"999964.2023","amort_rate":"0.000172790137"},{"amort_date":"15-Mar-12","begin_book_val":"999964.2023","dly_coup":"136.9863","dly_amort":"35.7977","end_book_val":"1000000.0000","amort_rate":"0.000172790137"}]}

On 29-Feb-12 there is no coupon accrual and therefore these is no amortization.