# Bond Yield to Maturity Calculator

> Bond Yield to Maturity Calculator is a paid API for AI agents from agent402.tools, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

Computes the yield to maturity (YTM) of a bond given its market price, coupon rate, face value, and time to maturity using bracketed bisection root-finding.

## Facts

- Endpoint: POST https://agent402.tools/api/bond-ytm
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/bond-yield-to-maturity-calculator-0d4aac06
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_8BYiU-jLFNycgZ-ZXHPD0

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability bond-yield-to-maturity-calculator-0d4aac06 -d '<json body>'
```

Example prompt: What's the yield to maturity on a bond with a face value of $1000, a 6% annual coupon paid semiannually, 10 years to maturity, currently trading at $950?

## When to prefer this

Use this endpoint when you need to solve for a bond's implied yield to maturity from its observed market price — particularly when you want a numerically robust root-finding approach (bisection) rather than an approximation formula. Ideal for fixed-income analysis, portfolio evaluation, or comparing bonds on a yield basis.

## Known failure modes

- Missing required fields (price, years, faceValue, couponRate) returns a 400-level error
- Non-convergence if price is outside plausible bounds for the bisection bracket
- Negative or zero years/faceValue causing arithmetic errors
- Invalid couponRate (e.g. >1 treated as a percentage rather than decimal) may produce unrealistic YTM
- periodsPerYear of 0 causes division error

## How this service works

Solve a bond's yield to maturity from its market price - the annual rate that present-values the coupons plus face to that price. Bracketed bisection root-find.

## Output

Returns the yield to maturity as an annual rate (decimal or percentage) — the internal rate of return that equates the present value of all future coupon payments and face value repayment to the given market price.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "price": {
   "type": "number",
   "description": "Current market (clean) price"
  },
  "years": {
   "type": "number",
   "description": "Years to maturity"
  },
  "faceValue": {
   "type": "number",
   "description": "Par/face value"
  },
  "couponRate": {
   "type": "number",
   "description": "Annual coupon rate as decimal"
  },
  "periodsPerYear": {
   "type": "number",
   "description": "Coupon periods per year. Default 2."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "periods": 20,
  "converged": true,
  "yieldToMaturity": 0.06
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bond-yield-to-maturity-calculator-0d4aac06/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
