Bond yield from price

bond-yield-from-price · version 1.0.0 · Financial calculations · free, no key needed

Yield to maturity of a fixed-coupon bond from its clean price, with accrued and dirty price (Excel YIELD / SIA).

Use when you need to: implied yield to maturity of a bond quoted at a price · YTM of a coupon bond · yield from clean price.

Decide before calling

Read the versioned contract and the supported scope below. Reuse bond-yield-from-price@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-yield-from-price@1.0.0 for implied yield to maturity of a bond quoted at a price. 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-02-15",
  "maturity": "2016-11-15",
  "coupon_rate": "0.0575",
  "frequency": 2,
  "clean_price": "95.04287",
  "basis": "30-360-us",
  "rate_scale": 6
}

Response:

{
  "result": {
    "yield": "0.065000",
    "dirty_price": "96.480370",
    "accrued_interest": "1.437500",
    "coupons_remaining": 18,
    "method": "root-finding"
  }
}

How to call it

MCP

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

{
  "id": "bond-yield-from-price",
  "version": "1.0.0",
  "input": {
    "settlement": "2008-02-15",
    "maturity": "2016-11-15",
    "coupon_rate": "0.0575",
    "frequency": 2,
    "clean_price": "95.04287",
    "basis": "30-360-us",
    "rate_scale": 6
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/bond-yield-from-price/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"settlement":"2008-02-15","maturity":"2016-11-15","coupon_rate":"0.0575","frequency":2,"clean_price":"95.04287","basis":"30-360-us","rate_scale":6}'

The machine-readable contract is at /v1/tools/bond-yield-from-price/versions/1.0.0.

CLI

node cli.mjs run bond-yield-from-price 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.