Bond duration and convexity API
The price of a coupon bond at a yield, with its Macaulay and modified duration, convexity and DV01, for any settlement date.
POST https://api.curatedapi.com/v1/calc/finance/bond-duration-convexity
- Version 1
- MCP tool
calc_finance_bond_duration_convexity - Try it in the browser
Prices a bond that pays periodic coupons by discounting each payment at the yield, and measures how the price reacts when the yield moves. Modified duration is the percentage fall in price for a rise of one percentage point in yield; convexity is the correction for larger moves; DV01 is the change in price, per 100 of face value, for one basis point. Between coupon dates the price is split into the clean price and accrued interest.
Formula
P = Σ CF_k·v^t_k, v = 1/(1 + y/f), t_k = k − 1 + days to next coupon ÷ days in period; Macaulay = Σ t_k·CF_k·v^t_k ÷ P ÷ f; modified = Macaulay·v; convexity = Σ t_k·(t_k + 1)·CF_k·v^(t_k + 2) ÷ (P·f²); DV01 = modified × P ÷ 10000
- Every payment is discounted with compound interest, including when only one coupon is left. Excel's PRICE switches to simple interest in that last period, so its price differs slightly there.
- Yield and convexity are in the bond's own compounding: a yield of 6% with two coupons a year is 3% per half-year.
- Dates from 1900-03-01. Coupon dates are counted back from maturity.
Inputs
Send numbers as strings to keep every digit. options sets precision and rounding (see numbers and rounding).
| Input | Type | Description |
|---|---|---|
settlement required |
date (YYYY-MM-DD) | Settlement date (when the buyer gets the bond). |
maturity required |
date (YYYY-MM-DD) | Maturity date. |
coupon_rate_percent required |
decimal (string) | Annual coupon rate in percent of face value. Allowed: >= 0 and <= 1000. Unit: percent. |
yield_percent required |
decimal (string) | Annual yield to maturity in percent, compounded at the coupon frequency. Allowed: > -50 and <= 1000. Unit: percent. |
redemption |
decimal (string) default 100 |
Amount repaid at maturity per 100 of face value. Allowed: > 0 and <= 1000000. |
frequency |
integer default 2 |
Coupons per year: 1, 2 or 4. Allowed: >= 1 and <= 4. |
day_count |
30/360 | actual/actual | actual/360 | actual/365 | 30e/360 default 30/360 |
How days are counted for accrued interest. Options: 30/360: US (NASD) 30/360; actual/actual: actual days over the actual length of the coupon period; actual/360: actual days over a 360-day year; actual/365: actual days over a 365-day year; 30e/360: European 30/360 |
options.rounding |
half_even | half_up | half_down | up | down | ceiling | floor | Rounding mode applied once to each result. Default half_even. |
options.decimals |
integer | Round results to this many digits after the decimal point. |
options.significant_digits |
integer | Round results to this many significant digits. |
Result
Under result in the answer, next to exactness, precision, inputs, formula, references and warnings.
| Result | Type | Description |
|---|---|---|
clean_price | decimal (string) | Price per 100 of face value without accrued interest. |
accrued_interest | decimal (string) | Coupon earned since the last coupon date. |
dirty_price | decimal (string) | What the buyer pays: clean price + accrued interest. |
macaulay_duration | decimal (string) | Weighted average time to the payments, in years. |
modified_duration | decimal (string) | Macaulay duration ÷ (1 + yield ÷ frequency). |
convexity | decimal (string) | The second derivative of price to yield, divided by price. |
dv01 | decimal (string) | Fall in price per 100 of face value for a rise of 0.01% in yield. |
coupons_remaining | integer | Coupons from settlement to maturity. |
Examples
A 10-year 5% semiannual bond at a 6% yield, on a coupon date
curl https://api.curatedapi.com/v1/calc/finance/bond-duration-convexity \
-H "Authorization: Bearer $CURATEDAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"settlement": "2026-03-15",
"maturity": "2036-03-15",
"coupon_rate_percent": "5",
"yield_percent": "6"
}'
{
"calculator": "finance/bond-duration-convexity@1",
"result": {
"clean_price": "92.561263",
"accrued_interest": "0.000000",
"dirty_price": "92.561263",
"macaulay_duration": "7.894997",
"modified_duration": "7.665046",
"convexity": "71.785398",
"dv01": "0.070949",
"coupons_remaining": 20
},
"exactness": {
"clean_price": "rounded",
"accrued_interest": "exact",
"dirty_price": "rounded",
"macaulay_duration": "rounded",
"modified_duration": "rounded",
"convexity": "rounded",
"dv01": "rounded"
},
"precision": {
"rounding": "half_even",
"decimals": 6
},
"inputs": {
"settlement": "2026-03-15",
"maturity": "2036-03-15",
"coupon_rate_percent": "5",
"yield_percent": "6",
"redemption": "100",
"frequency": 2,
"day_count": "30/360"
},
"formula": "P = Σ CF_k·v^t_k, v = 1/(1 + y/f), t_k = k − 1 + days to next coupon ÷ days in period; Macaulay = Σ t_k·CF_k·v^t_k ÷ P ÷ f; modified = Macaulay·v; convexity = Σ t_k·(t_k + 1)·CF_k·v^(t_k + 2) ÷ (P·f²); DV01 = modified × P ÷ 10000",
"references": [
{
"title": "Microsoft Excel DURATION function",
"url": "https://support.microsoft.com/en-us/excel/functions/duration-function"
},
{
"title": "Microsoft Excel MDURATION function",
"url": "https://support.microsoft.com/en-us/excel/functions/mduration-function"
},
{
"title": "FINRA: Bond yield and return (yield to maturity and yield to call)",
"url": "https://www.finra.org/investors/insights/bond-yield-return"
}
],
"warnings": []
}
References
- Microsoft Excel DURATION function
- Microsoft Excel MDURATION function
- FINRA: Bond yield and return (yield to maturity and yield to call)
Results follow each calculator's documented rules and the sources listed. They are not financial, tax or legal advice. Check that the rules fit your case before you rely on a result. See the terms.
Errors share one format; see errors. Billing, retries and batches work the same for every endpoint.