# finmath XNPV — Extended Net Present Value Calculator

> finmath XNPV — Extended Net Present Value 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 exact Net Present Value of irregular cash flows discounted at a specified rate, accounting for actual calendar dates between cash flows (XNPV formula).

## Facts

- Endpoint: POST https://finmath.qzqh5rrbkz.workers.dev/v1/xnpv
- 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-xnpv-extended-net-present-value-calculator-a7ade54c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_I3XC8luMsoFaHRBCxipu5

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-xnpv-extended-net-present-value-calculator-a7ade54c -d '<json body>'
```

Example prompt: Calculate the XNPV for a series of cash flows: -100000 on 2024-01-01, 30000 on 2024-06-15, 40000 on 2025-01-20, and 50000 on 2025-08-30, using an annual discount rate of 10%.

## When to prefer this

Use this endpoint when you need exact, deterministic XNPV computation with actual calendar-date discounting rather than periodic NPV — especially when cash flows occur on irregular dates (not evenly spaced intervals). Prefer this over asking an LLM to compute NPV directly, as LLMs routinely make arithmetic errors in financial calculations. Ideal for DCF models, private equity IRR analysis, bond pricing with odd first/last periods, or any scenario where cash flow timing precision matters.

## Known failure modes

- Missing required fields (rate, dates, or cashflows) returns a 400-level error
- Mismatched array lengths between dates and cashflows causes validation failure
- Malformed date strings not parseable as calendar dates cause parsing errors
- Rate of -1 (or exactly -100%) causes division-by-zero style numerical error
- Payment failure (insufficient USDC balance) returns HTTP 402 before computation

## 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 exact XNPV scalar value — the net present value computed using actual day-count differences between the provided dates — plus a 'meta' object with call metadata. The computation is deterministic and model-free.

## Example request

```json
{
 "rate": 0.05,
 "dates": [
  "2024-01-01",
  "2024-06-30",
  "2025-01-01"
 ],
 "cashflows": [
  -1000,
  500,
  600
 ]
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "rate",
  "dates",
  "cashflows"
 ],
 "properties": {
  "rate": {
   "type": "number",
   "description": "rate"
  },
  "dates": {
   "type": "array",
   "description": "dates"
  },
  "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-xnpv-extended-net-present-value-calculator-a7ade54c/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)
