# finmath Bond Yield to Maturity (YTM) Calculator

> finmath Bond Yield to Maturity (YTM) Calculator is a paid API for AI agents from finmath.qzqh5rrbkz.workers.dev, 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 face value, market price, coupon rate, maturity, and payment frequency.

## Facts

- Endpoint: POST https://finmath.qzqh5rrbkz.workers.dev/v1/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/finmath-bond-yield-to-maturity-ytm-calculator-f340ca49
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FV2M3_9CXnaK2fPPjhUy5

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 finmath-bond-yield-to-maturity-ytm-calculator-f340ca49 -d '<json body>'
```

Example prompt: What's the yield to maturity on a bond with a $1,000 face value, currently priced at $950, a 5% annual coupon rate, 10 years to maturity, and semi-annual coupon payments?

## When to prefer this

Use this endpoint when you need exact, deterministic bond YTM calculations rather than relying on an LLM's arithmetic. Ideal for fixed income analysis, portfolio tools, or any workflow requiring precise yield math. Prefer this over general-purpose LLMs which are known to make arithmetic errors on iterative financial computations like YTM.

## Known failure modes

- Missing required fields (face, price, coupon_rate) returns a validation error
- Negative or zero price/face value may cause computation errors
- Impossible yield scenarios (e.g. price far exceeding face with no plausible YTM) may fail to converge
- Non-numeric inputs for numeric fields will cause schema validation failure

## How this service works

Deterministic finance and crypto math for AI agents: TradFi (NPV, IRR, XIRR, Black-Scholes + Greeks, bonds, VaR, Sharpe) and DeFi (impermanent loss, perp liquidation, funding, Uniswap v3, health factor, cost basis). Exact, model-free arithmetic that LLMs get wrong — priced per call in USDC.

## Output

Returns the calculated yield to maturity (YTM) as an annualized rate, along with metadata about the computation. The result is a deterministic, exact arithmetic answer — not an LLM estimate.

## Example request

```json
{
 "face": 1000,
 "freq": 2,
 "price": 950,
 "years": 5,
 "coupon_rate": 0.05
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "face",
  "price",
  "coupon_rate"
 ],
 "properties": {
  "face": {
   "type": "number",
   "description": "face"
  },
  "freq": {
   "type": "number",
   "description": "freq"
  },
  "price": {
   "type": "number",
   "description": "price"
  },
  "years": {
   "type": "number",
   "description": "years"
  },
  "coupon_rate": {
   "type": "number",
   "description": "coupon_rate"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "result",
  "meta"
 ],
 "properties": {
  "meta": {
   "type": "object"
  },
  "result": {}
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/finmath-bond-yield-to-maturity-ytm-calculator-f340ca49/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from finmath.qzqh5rrbkz.workers.dev](https://www.zero.xyz/host/finmath.qzqh5rrbkz.workers.dev/llms.txt)
