# finmath NPV Calculator

> finmath NPV Calculator is a paid API for AI agents from finmath.qzqh5rrbkz.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Computes the Net Present Value (NPV) of a series of cash flows at a given discount rate using exact arithmetic

## Facts

- Endpoint: POST https://finmath.qzqh5rrbkz.workers.dev/v1/npv
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/finmath-npv-calculator-781e06d1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_GWiAtAmqt3UZQLKWVxC0S

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-npv-calculator-781e06d1 -d '<json body>'
```

Example prompt: Calculate the NPV of an investment with a 10% annual discount rate and the following cash flows: year 0 is -50000, year 1 is 15000, year 2 is 20000, year 3 is 25000, and year 4 is 20000.

## When to prefer this

Use this endpoint when you need exact, deterministic NPV calculations that LLMs tend to get wrong due to floating-point approximations. Prefer over LLM-native math when precision matters for investment decisions, financial modeling, or auditable results. Best for agents doing capital budgeting, project valuation, or loan analysis.

## Known failure modes

- Missing required 'rate' field returns a 400-level error
- Missing or empty 'cashflows' array returns a 400-level error
- Non-numeric values in cashflows array may cause a validation error
- Payment failure (insufficient USDC balance) blocks execution with 402 response

## 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 a JSON object with a 'result' field containing the computed NPV value and a 'meta' field with computation metadata such as timing or model details.

## Example request

```json
{
 "rate": 0.1,
 "cashflows": [
  -50000,
  15000,
  20000,
  25000,
  20000
 ]
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "rate",
  "cashflows"
 ],
 "properties": {
  "rate": {
   "type": "number",
   "description": "rate"
  },
  "cashflows": {
   "type": "array",
   "description": "cashflows"
  }
 }
}
```

## 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-npv-calculator-781e06d1/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)
