Bond duration convexity

bond-duration-convexity · version 1.0.0 · Financial calculations · free, no key needed

Macaulay and modified duration, convexity and DV01 of a fixed-coupon bond at a yield (Excel DURATION, MDURATION).

Use when you need to: macaulay duration of a bond · modified duration from yield · bond convexity calculation.

Decide before calling

Read the versioned contract and the supported scope below. Reuse bond-duration-convexity@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use bond-duration-convexity@1.0.0 for macaulay duration of a bond. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "settlement": "2008-01-01",
  "maturity": "2016-01-01",
  "coupon_rate": "0.08",
  "frequency": 2,
  "yield": "0.09",
  "basis": "act-act"
}

Response:

{
  "result": {
    "macaulay_duration": "5.9937749555",
    "modified_duration": "5.7356698139",
    "convexity": "41.9576028358",
    "dv01": "0.054135",
    "dirty_price": "94.382992",
    "coupons_remaining": 16
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "bond-duration-convexity",
  "version": "1.0.0",
  "input": {
    "settlement": "2008-01-01",
    "maturity": "2016-01-01",
    "coupon_rate": "0.08",
    "frequency": 2,
    "yield": "0.09",
    "basis": "act-act"
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/bond-duration-convexity/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"settlement":"2008-01-01","maturity":"2016-01-01","coupon_rate":"0.08","frequency":2,"yield":"0.09","basis":"act-act"}'

The machine-readable contract is at /v1/tools/bond-duration-convexity/versions/1.0.0.

CLI

node cli.mjs run bond-duration-convexity 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.