Bond price from yield

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

Clean price, dirty price and accrued interest per 100 of a fixed-coupon bond from its yield (Excel PRICE, SIA).

Use when you need to: price a bond given its yield to maturity · clean price of a bond · dirty price of a bond with accrued interest.

Decide before calling

Read the versioned contract and the supported scope below. Reuse bond-price-from-yield@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-price-from-yield@1.0.0 for price a bond given its yield to maturity. 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": "2017-11-15",
  "coupon_rate": "0.0575",
  "frequency": 2,
  "yield": "0.065",
  "basis": "30-360-us",
  "scale": 5
}

Response:

{
  "result": {
    "clean_price": "94.63436",
    "dirty_price": "96.07186",
    "accrued_interest": "1.43750",
    "coupons_remaining": 20,
    "accrued_days": 90,
    "days_to_next_coupon": 90,
    "period_days": "180.000000"
  }
}

How to call it

MCP

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

{
  "id": "bond-price-from-yield",
  "version": "1.0.0",
  "input": {
    "settlement": "2008-02-15",
    "maturity": "2017-11-15",
    "coupon_rate": "0.0575",
    "frequency": 2,
    "yield": "0.065",
    "basis": "30-360-us",
    "scale": 5
  }
}

HTTP (no key)

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

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

CLI

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

Get the client at /clients/cli/.