Logo

SQL Server BONDAMORT Function

Updated 2023-10-06 13:15:14.393000

Description

Use the table-valued function BONDAMORT to generate a bond amortization schedule, given the settlement and maturity dates of the bond, the clean price, the face amount, the redemption amount, and the coupon rate. Additionally, if the bond has an odd first or an odd last period, that information can be included in the amortization schedule. The amortization schedule includes the date, the number of days to maturity, the beginning book value, the daily coupon amount, the daily amortization amount, the daily effective amount (which is the daily coupon + the daily amortization), and the ending book balance. The amortization follows the coupon accruals, so there might be some days with no coupon accruals and no amortization, as well as some days with multiple days accrued and therefore multiple amortization.

Syntax

SELECT * FROM [westclintech].[wct].[BONDAMORT](
  <@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),>)

Arguments

@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.

@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.

@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.

@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.

@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.

@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.

@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.

@BasisDay count basis
0 or omittedUS (NASD) 30/360
1Actual/Actual
2Actual/360
3Actual/365
4European 30/360
530/360 ISDA
6NL/ACT
7NL/365
8NL/360
9A/364
10US (NASD) 30/360 non-end-of-month
11Actual/Actual non-end-of-month
12Actual/360 non-end-of-month
13Actual/365 non-end-of-month
14European 30/360 non-end-of-month
1530/360 ISDA non-end-of-month
16NL/ACT non-end-of-month
17NL/365 non-end-of-month
18NL/360 non-end-of-month
19A/364 non-end-of-month
20BUS/252
21Actual/ISDA
22Actual/ISMA
23Actual/365L
24Actual/AFB
2530E+360
30BUS/252 non-end-of-month

@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.

@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.

@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.

@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

table

colNamecolDatatypecolDesc
amort_datedatetimeThe date of the amortization. There will be an amort_date row returned for each day from the settlement date through to the maturity date.
dtmintThe number of days-to-maturity using the specified day-count convention.
begin_book_valfloatThe beginning book value on the amort_date. begin_book_val equals end_book_val from the previous amort_date
dly_coupfloatThe daily coupon accrual based on the day-count convention, face amount, and coupon rate.
dly_eff_ratefloatThe daily income recognized based upon the constant daily effective rate (calculated by the tvf) and the begin_book_val. You can use the AMORTRATE to calculate the constant daily effective rate, or you simply divided the dly_eff_rate by the begin_book_val.
dly_amortfloatThe daily amortization amount. The difference between the dly_eff_rate and the dly_coup.
end_book_valfloatThe begin_bool_val plus dly_amort."

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 *
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_datedtmbegin_book_valdly_coupdly_eff_ratedly_amortend_book_val
2012-05-03580.00000.00000.00000.0000999000.0000
2012-05-0457999000.0000136.9863154.152017.1657999017.1657
2012-05-0556999017.1657136.9863154.154617.1683999034.3340
2012-05-0655999034.3340136.9863154.157317.1710999051.5050
2012-05-0754999051.5050136.9863154.159917.1736999068.6786
2012-05-0853999068.6786136.9863154.162617.1763999085.8548
2012-05-0952999085.8548136.9863154.165217.1789999103.0338
2012-05-1051999103.0338136.9863154.167917.1816999120.2153
2012-05-1150999120.2153136.9863154.170517.1842999137.3996
2012-05-1249999137.3996136.9863154.173217.1869999154.5864
2012-05-1348999154.5864136.9863154.175817.1895999171.7760
2012-05-1447999171.7760136.9863154.178517.1922999188.9681
2012-05-1546999188.9681136.9863154.181117.1948999206.1630
2012-05-1645999206.1630136.9863154.183817.1975999223.3604
2012-05-1744999223.3604136.9863154.186417.2001999240.5606
2012-05-1843999240.5606136.9863154.189117.2028999257.7634
2012-05-1942999257.7634136.9863154.191717.2054999274.9688
2012-05-2041999274.9688136.9863154.194417.2081999292.1769
2012-05-2140999292.1769136.9863154.197117.2108999309.3877
2012-05-2239999309.3877136.9863154.199717.2134999326.6011
2012-05-2338999326.6011136.9863154.202417.2161999343.8172
2012-05-2437999343.8172136.9863154.205017.2187999361.0359
2012-05-2536999361.0359136.9863154.207717.2214999378.2573
2012-05-2635999378.2573136.9863154.210317.2240999395.4813
2012-05-2734999395.4813136.9863154.213017.2267999412.7080
2012-05-2833999412.7080136.9863154.215717.2294999429.9374
2012-05-2932999429.9374136.9863154.218317.2320999447.1694
2012-05-3031999447.1694136.9863154.221017.2347999464.4040
2012-05-3130999464.4040136.9863154.223617.2373999481.6414
2012-06-0129999481.6414136.9863154.226317.2400999498.8814
2012-06-0228999498.8814136.9863154.229017.2427999516.1240
2012-06-0327999516.1240136.9863154.231617.2453999533.3693
2012-06-0426999533.3693136.9863154.234317.2480999550.6173
2012-06-0525999550.6173136.9863154.236917.2506999567.8679
2012-06-0624999567.8679136.9863154.239617.2533999585.1212
2012-06-0723999585.1212136.9863154.242317.2560999602.3772
2012-06-0822999602.3772136.9863154.244917.2586999619.6358
2012-06-0921999619.6358136.9863154.247617.2613999636.8971
2012-06-1020999636.8971136.9863154.250317.2639999654.1611
2012-06-1119999654.1611136.9863154.252917.2666999671.4277
2012-06-1218999671.4277136.9863154.255617.2693999688.6969
2012-06-1317999688.6969136.9863154.258217.2719999705.9689
2012-06-1416999705.9689136.9863154.260917.2746999723.2435
2012-06-1515999723.2435136.9863154.263617.2773999740.5208
2012-06-1614999740.5208136.9863154.266217.2799999757.8007
2012-06-1713999757.8007136.9863154.268917.2826999775.0833
2012-06-1812999775.0833136.9863154.271617.2853999792.3686
2012-06-1911999792.3686136.9863154.274217.2879999809.6565
2012-06-2010999809.6565136.9863154.276917.2906999826.9471
2012-06-219999826.9471136.9863154.279617.2933999844.2404
2012-06-228999844.2404136.9863154.282217.2959999861.5363
2012-06-237999861.5363136.9863154.284917.2986999878.8350
2012-06-246999878.8350136.9863154.287617.3013999896.1362
2012-06-255999896.1362136.9863154.290317.3040999913.4402
2012-06-264999913.4402136.9863154.292917.3066999930.7468
2012-06-273999930.7468136.9863154.295617.3093999948.0561
2012-06-282999948.0561136.9863154.298317.3120999965.3681
2012-06-291999965.3681136.9863154.300917.3146999982.6827
2012-06-300999982.6827136.9863154.303617.31731000000.0000

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

SELECT *
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.

amort_datedtmbegin_book_valdly_coupdly_eff_ratedly_amortend_book_val
2012-05-03570.00000.00000.00000.0000999000.0000
2012-05-0456999000.0000138.8889156.356017.4671999017.4671
2012-05-0555999017.4671138.8889156.358717.4698999034.9369
2012-05-0654999034.9369138.8889156.361417.4726999052.4095
2012-05-0753999052.4095138.8889156.364217.4753999069.8848
2012-05-0852999069.8848138.8889156.366917.4780999087.3628
2012-05-0951999087.3628138.8889156.369717.4808999104.8436
2012-05-1050999104.8436138.8889156.372417.4835999122.3271
2012-05-1149999122.3271138.8889156.375117.4862999139.8133
2012-05-1248999139.8133138.8889156.377917.4890999157.3023
2012-05-1347999157.3023138.8889156.380617.4917999174.7940
2012-05-1446999174.7940138.8889156.383317.4945999192.2884
2012-05-1545999192.2884138.8889156.386117.4972999209.7856
2012-05-1644999209.7856138.8889156.388817.4999999227.2856
2012-05-1743999227.2856138.8889156.391617.5027999244.7882
2012-05-1842999244.7882138.8889156.394317.5054999262.2936
2012-05-1941999262.2936138.8889156.397017.5081999279.8018
2012-05-2040999279.8018138.8889156.399817.5109999297.3127
2012-05-2139999297.3127138.8889156.402517.5136999314.8263
2012-05-2238999314.8263138.8889156.405317.5164999332.3427
2012-05-2337999332.3427138.8889156.408017.5191999349.8618
2012-05-2436999349.8618138.8889156.410717.5219999367.3836
2012-05-2535999367.3836138.8889156.413517.5246999384.9082
2012-05-2634999384.9082138.8889156.416217.5273999402.4355
2012-05-2733999402.4355138.8889156.419017.5301999419.9656
2012-05-2832999419.9656138.8889156.421717.5328999437.4984
2012-05-2931999437.4984138.8889156.424517.5356999455.0340
2012-05-3030999455.0340138.8889156.427217.5383999472.5723
2012-05-3130999472.57230.00000.00000.0000999472.5723
2012-06-0129999472.5723138.8889156.429917.5411999490.1134
2012-06-0228999490.1134138.8889156.432717.5438999507.6572
2012-06-0327999507.6572138.8889156.435417.5465999525.2037
2012-06-0426999525.2037138.8889156.438217.5493999542.7530
2012-06-0525999542.7530138.8889156.440917.5520999560.3051
2012-06-0624999560.3051138.8889156.443717.5548999577.8599
2012-06-0723999577.8599138.8889156.446417.5575999595.4174
2012-06-0822999595.4174138.8889156.449217.5603999612.9777
2012-06-0921999612.9777138.8889156.451917.5630999630.5407
2012-06-1020999630.5407138.8889156.454717.5658999648.1065
2012-06-1119999648.1065138.8889156.457417.5685999665.6750
2012-06-1218999665.6750138.8889156.460217.5713999683.2463
2012-06-1317999683.2463138.8889156.462917.5740999700.8203
2012-06-1416999700.8203138.8889156.465717.5768999718.3971
2012-06-1515999718.3971138.8889156.468417.5795999735.9766
2012-06-1614999735.9766138.8889156.471217.5823999753.5589
2012-06-1713999753.5589138.8889156.473917.5850999771.1439
2012-06-1812999771.1439138.8889156.476717.5878999788.7317
2012-06-1911999788.7317138.8889156.479417.5905999806.3223
2012-06-2010999806.3223138.8889156.482217.5933999823.9156
2012-06-219999823.9156138.8889156.484917.5960999841.5116
2012-06-228999841.5116138.8889156.487717.5988999859.1104
2012-06-237999859.1104138.8889156.490417.6016999876.7120
2012-06-246999876.7120138.8889156.493217.6043999894.3163
2012-06-255999894.3163138.8889156.496017.6071999911.9233
2012-06-264999911.9233138.8889156.498717.6098999929.5332
2012-06-273999929.5332138.8889156.501517.6126999947.1457
2012-06-282999947.1457138.8889156.504217.6153999964.7611
2012-06-291999964.7611138.8889156.507017.6181999982.3792
2012-06-300999982.3792138.8889156.509717.62081000000.0000

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 *
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.

amort_datedtmbegin_book_valdly_coupdly_eff_ratedly_amortend_book_val
2012-02-15300.00000.00000.00000.0000999000.0000
2012-02-1629999000.0000138.8889172.139033.2501999033.2501
2012-02-1728999033.2501138.8889172.144733.2559999066.5060
2012-02-1827999066.5060138.8889172.150533.2616999099.7676
2012-02-1926999099.7676138.8889172.156233.2673999133.0349
2012-02-2025999133.0349138.8889172.161933.2730999166.3079
2012-02-2124999166.3079138.8889172.167733.2788999199.5867
2012-02-2223999199.5867138.8889172.173433.2845999232.8712
2012-02-2322999232.8712138.8889172.179133.2903999266.1615
2012-02-2421999266.1615138.8889172.184933.2960999299.4575
2012-02-2520999299.4575138.8889172.190633.3017999332.7592
2012-02-2619999332.7592138.8889172.196433.3075999366.0666
2012-02-2718999366.0666138.8889172.202133.3132999399.3798
2012-02-2817999399.3798138.8889172.207833.3189999432.6988
2012-02-2915999432.6988277.7778344.432966.6551999499.3539
2012-03-0114999499.3539138.8889172.225133.3362999532.6901
2012-03-0213999532.6901138.8889172.230833.3419999566.0320
2012-03-0312999566.0320138.8889172.236533.3477999599.3796
2012-03-0411999599.3796138.8889172.242333.3534999632.7330
2012-03-0510999632.7330138.8889172.248033.3592999666.0922
2012-03-069999666.0922138.8889172.253833.3649999699.4571
2012-03-078999699.4571138.8889172.259533.3706999732.8277
2012-03-087999732.8277138.8889172.265333.3764999766.2041
2012-03-096999766.2041138.8889172.271033.3821999799.5863
2012-03-105999799.5863138.8889172.276833.3879999832.9742
2012-03-114999832.9742138.8889172.282533.3937999866.3678
2012-03-123999866.3678138.8889172.288333.3994999899.7672
2012-03-132999899.7672138.8889172.294133.4052999933.1724
2012-03-141999933.1724138.8889172.299833.4109999966.5833
2012-03-150999966.5833138.8889172.305633.41671000000.0000

Notice that for 2012-02-29 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.

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

SELECT *
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.

amort_datedtmbegin_book_valdly_coupdly_eff_ratedly_amortend_book_val
2012-02-15280.00000.00000.00000.0000999000.0000
2012-02-1627999000.0000136.9863172.617335.6310999035.6310
2012-02-1726999035.6310136.9863172.623535.6372999071.2682
2012-02-1825999071.2682136.9863172.629735.6434999106.9116
2012-02-1924999106.9116136.9863172.635835.6495999142.5611
2012-02-2023999142.5611136.9863172.642035.6557999178.2168
2012-02-2122999178.2168136.9863172.648135.6618999213.8786
2012-02-2221999213.8786136.9863172.654335.6680999249.5466
2012-02-2320999249.5466136.9863172.660535.6742999285.2208
2012-02-2419999285.2208136.9863172.666635.6803999320.9011
2012-02-2518999320.9011136.9863172.672835.6865999356.5876
2012-02-2617999356.5876136.9863172.679035.6927999392.2803
2012-02-2716999392.2803136.9863172.685135.6988999427.9791
2012-02-2815999427.9791136.9863172.691335.7050999463.6841
2012-02-2914999463.68410.00000.00000.0000999463.6841
2012-03-0114999463.6841136.9863172.697535.7112999499.3953
2012-03-0213999499.3953136.9863172.703635.7173999535.1126
2012-03-0312999535.1126136.9863172.709835.7235999570.8361
2012-03-0411999570.8361136.9863172.716035.7297999606.5658
2012-03-0510999606.5658136.9863172.722235.7359999642.3017
2012-03-069999642.3017136.9863172.728335.7420999678.0437
2012-03-078999678.0437136.9863172.734535.7482999713.7919
2012-03-087999713.7919136.9863172.740735.7544999749.5463
2012-03-096999749.5463136.9863172.746935.7606999785.3068
2012-03-105999785.3068136.9863172.753035.7667999821.0736
2012-03-114999821.0736136.9863172.759235.7729999856.8465
2012-03-123999856.8465136.9863172.765435.7791999892.6256
2012-03-132999892.6256136.9863172.771635.7853999928.4109
2012-03-141999928.4109136.9863172.777835.7915999964.2023
2012-03-150999964.2023136.9863172.784035.79771000000.0000

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

Let's look at a bond which accrues on an actual/actual basis.

SELECT *
FROM wct.BONDAMORT(   '2012-03-10', --Settlement
                      '2022-03-15', --Maturity
                      0.05,         --Rate
                      1000000.00,   --FaceAmount
                      990000.00,    --CleanPrice
                      NULL,         --Redemption
                      2,            --Frequency
                      '1',          --Basis
                      NULL,         --IssueDate
                      NULL,         --FirstInterestDate
                      NULL,         --LastInterestDate
                      NULL          --Holidays 
                  )
WHERE amort_date < '2012-03-20';

This produces the following result.

amort_datedtmbegin_book_valdly_coupdly_eff_ratedly_amortend_book_valamort_rate
2012-03-1036570.00000.00000.00000.0000990000.00000.000000000
2012-03-113656990000.0000137.3626138.99341.6308990001.63080.000140397
2012-03-123655990001.6308137.3626138.99361.6310990003.26180.000140397
2012-03-133654990003.2618137.3626138.99391.6312990004.89300.000140397
2012-03-143653990004.8930137.3626138.99411.6315990006.52440.000140397
2012-03-153652990006.5244137.3626138.99431.6317990008.15610.000140397
2012-03-163651990008.1561135.8696138.99453.1250990011.28110.000140397
2012-03-173650990011.2811135.8696138.99503.1254990014.40650.000140397
2012-03-183649990014.4065135.8696138.99543.1259990017.53240.000140397
2012-03-193648990017.5324135.8696138.99593.1263990020.65870.000140397

Notice the on 2012-03-16 the dly_coup changed from 137.3626 to 135.8696 and the dly_amort changed from 1.6317 to 3.1250. The dly_eff_rate, however, only changed slightly, from 138.9943 to 138.9945 and the (calculated) amort_rate did not change at all. In fact, if we were to look at the last 10 days of the amortization schedule we would see that the (calculated) amortization rate is still the same.

SELECT *,
       CASE
           WHEN begin_book_val = 0 THEN
               0
           ELSE
               dly_eff_rate / begin_book_val
       END as amort_rate
FROM wct.BONDAMORT(   '2012-03-10', --Settlement
                      '2022-03-15', --Maturity
                      0.05,         --Rate
                      1000000.00,   --FaceAmount
                      990000.00,    --CleanPrice
                      NULL,         --Redemption
                      2,            --Frequency
                      '1',          --Basis
                      NULL,         --IssueDate
                      NULL,         --FirstInterestDate
                      NULL,         --LastInterestDate
                      NULL          --Holidays 
                  )
WHERE dtm < 10;

This produces the following result.

amort_datedtmbegin_book_valdly_coupdly_eff_ratedly_amortend_book_valamort_rate
2022-03-069999977.2593138.1215140.39422.2726999979.53190.000140397
2022-03-078999979.5319138.1215140.39452.2730999981.80490.000140397
2022-03-087999981.8049138.1215140.39482.2733999984.07810.000140397
2022-03-096999984.0781138.1215140.39512.2736999986.35170.000140397
2022-03-105999986.3517138.1215140.39552.2739999988.62560.000140397
2022-03-114999988.6256138.1215140.39582.2742999990.89990.000140397
2022-03-123999990.8999138.1215140.39612.2746999993.17440.000140397
2022-03-132999993.1744138.1215140.39642.2749999995.44930.000140397
2022-03-141999995.4493138.1215140.39672.2752999997.72450.000140397
2022-03-150999997.7245138.1215140.39712.27551000000.00000.000140397

Finally, here's an example of a Brazilian NTN-F. We have stored the Brazilian holidays in a table called Holidays, which is keyed by country code, and used the NBD aggregate function to create the input to Holidays parameter of the BONDAMORT function.

DECLARE @hol as varchar(max);
SET @hol
    = '20110101,20110307,20110308,20110421,20110422,20110501,20110623,20110907,
              20111012,20111102,20111115,20111225,20120101,20120220,20120221,
              20120406,20120421,20120501,20120607,20120907,20121012,20121102,
              20121115,20121225,20130101,20130211,20130212,20130329,20130421,
              20130501,20130530,20130907,20131012,20131102,20131115,20131225';
SELECT *,
       CASE
           WHEN begin_book_val = 0 THEN
               0
           ELSE
               dly_eff_rate / begin_book_val
       END as amort_rate
FROM wct.BONDAMORT(   '2011-12-15', --Settlement
                      '2013-01-03', --Maturity
                      0.10,         --Rate
                      1000000.00,   --FaceAmount
                      1038692.42,   --CleanPrice
                      NULL,         --Redemption
                      2,            --Frequency
                      '20',         --Basis
                      NULL,         --IssueDate
                      NULL,         --FirstInterestDate
                      NULL,         --LastInterestDate
                      @hol          --Holidays 
                  )
WHERE amort_date < '2012-03-01';
amort_datedtmbegin_book_valdly_coupdly_eff_ratedly_amortend_book_valamort_rate
2011-12-152640.00000.00000.00000.00001038692.42000.00000000
2011-12-162631038692.4200384.3216246.6708-137.65081038554.76920.00023748
2011-12-172631038554.76920.00000.00000.00001038554.76920.00000000
2011-12-182631038554.76920.00000.00000.00001038554.76920.00000000
2011-12-192621038554.7692384.3216246.6381-137.68351038417.08570.00023748
2011-12-202611038417.0857384.3216246.6054-137.71621038279.36950.00023748
2011-12-212601038279.3695384.3216246.5727-137.74891038141.62060.00023748
2011-12-222591038141.6206384.3216246.5400-137.78161038003.83890.00023748
2011-12-232581038003.8389384.3216246.5073-137.81431037866.02460.00023748
2011-12-242581037866.02460.00000.00000.00001037866.02460.00000000
2011-12-252581037866.02460.00000.00000.00001037866.02460.00000000
2011-12-262571037866.0246384.3216246.4746-137.84711037728.17750.00023748
2011-12-272561037728.1775384.3216246.4418-137.87981037590.29770.00023748
2011-12-282551037590.2977384.3216246.4091-137.91261037452.38520.00023748
2011-12-292541037452.3852384.3216246.3763-137.94531037314.43990.00023748
2011-12-302531037314.4399384.3216246.3436-137.97811037176.46180.00023748
2011-12-312531037176.46180.00000.00000.00001037176.46180.00000000
2012-01-012531037176.46180.00000.00000.00001037176.46180.00000000
2012-01-022521037176.4618384.3216246.3108-138.01081037038.45100.00023748
2012-01-032511037038.4510384.3216246.2780-138.04361036900.40740.00023748
2012-01-042501036900.4074390.4708246.2453-144.22551036756.18180.00023748
2012-01-052491036756.1818390.4708246.2110-144.25981036611.92200.00023748
2012-01-062481036611.9220390.4708246.1767-144.29401036467.62800.00023748
2012-01-072481036467.62800.00000.00000.00001036467.62800.00000000
2012-01-082481036467.62800.00000.00000.00001036467.62800.00000000
2012-01-092471036467.6280390.4708246.1425-144.32831036323.29970.00023748
2012-01-102461036323.2997390.4708246.1082-144.36261036178.93710.00023748
2012-01-112451036178.9371390.4708246.0739-144.39691036034.54020.00023748
2012-01-122441036034.5402390.4708246.0396-144.43121035890.10910.00023748
2012-01-132431035890.1091390.4708246.0053-144.46551035745.64360.00023748
2012-01-142431035745.64360.00000.00000.00001035745.64360.00000000
2012-01-152431035745.64360.00000.00000.00001035745.64360.00000000
2012-01-162421035745.6436390.4708245.9710-144.49981035601.14380.00023748
2012-01-172411035601.1438390.4708245.9367-144.53411035456.60980.00023748
2012-01-182401035456.6098390.4708245.9024-144.56841035312.04130.00023748
2012-01-192391035312.0413390.4708245.8680-144.60271035167.43860.00023748
2012-01-202381035167.4386390.4708245.8337-144.63711035022.80150.00023748
2012-01-212381035022.80150.00000.00000.00001035022.80150.00000000
2012-01-222381035022.80150.00000.00000.00001035022.80150.00000000
2012-01-232371035022.8015390.4708245.7994-144.67141034878.13010.00023748
2012-01-242361034878.1301390.4708245.7650-144.70581034733.42430.00023748
2012-01-252351034733.4243390.4708245.7306-144.74021034588.68410.00023748
2012-01-262341034588.6841390.4708245.6963-144.77451034443.90960.00023748
2012-01-272331034443.9096390.4708245.6619-144.80891034299.10070.00023748
2012-01-282331034299.10070.00000.00000.00001034299.10070.00000000
2012-01-292331034299.10070.00000.00000.00001034299.10070.00000000
2012-01-302321034299.1007390.4708245.6275-144.84331034154.25740.00023748
2012-01-312311034154.2574390.4708245.5931-144.87771034009.37970.00023748
2012-02-012301034009.3797390.4708245.5587-144.91211033864.46760.00023748
2012-02-022291033864.4676390.4708245.5243-144.94651033719.52110.00023748
2012-02-032281033719.5211390.4708245.4898-144.98091033574.54020.00023748
2012-02-042281033574.54020.00000.00000.00001033574.54020.00000000
2012-02-052281033574.54020.00000.00000.00001033574.54020.00000000
2012-02-062271033574.5402390.4708245.4554-145.01541033429.52480.00023748
2012-02-072261033429.5248390.4708245.4210-145.04981033284.47500.00023748
2012-02-082251033284.4750390.4708245.3865-145.08431033139.39070.00023748
2012-02-092241033139.3907390.4708245.3521-145.11871032994.27200.00023748
2012-02-102231032994.2720390.4708245.3176-145.15321032849.11880.00023748
2012-02-112231032849.11880.00000.00000.00001032849.11880.00000000
2012-02-122231032849.11880.00000.00000.00001032849.11880.00000000
2012-02-132221032849.1188390.4708245.2831-145.18761032703.93120.00023748
2012-02-142211032703.9312390.4708245.2487-145.22211032558.70910.00023748
2012-02-152201032558.7091390.4708245.2142-145.25661032413.45250.00023748
2012-02-162191032413.4525390.4708245.1797-145.29111032268.16140.00023748
2012-02-172181032268.1614390.4708245.1452-145.32561032122.83580.00023748
2012-02-182181032122.83580.00000.00000.00001032122.83580.00000000
2012-02-192181032122.83580.00000.00000.00001032122.83580.00000000
2012-02-202181032122.83580.00000.00000.00001032122.83580.00000000
2012-02-212181032122.83580.00000.00000.00001032122.83580.00000000
2012-02-222171032122.8358390.4708245.1107-145.36011031977.47560.00023748
2012-02-232161031977.4756390.4708245.0761-145.39461031832.08100.00023748
2012-02-242151031832.0810390.4708245.0416-145.42921031686.65180.00023748
2012-02-252151031686.65180.00000.00000.00001031686.65180.00000000
2012-02-262151031686.65180.00000.00000.00001031686.65180.00000000
2012-02-272141031686.6518390.4708245.0071-145.46371031541.18810.00023748
2012-02-282131031541.1881390.4708244.9725-145.49831031395.68990.00023748
2012-02-292121031395.6899390.4708244.9380-145.53281031250.15710.00023748

Notice that there is no amortization or interest accrual on Saturdays or Sundays or on non-business days like 2012-02-20 and 2012-02-21.