{"uid":"cap_I3XC8luMsoFaHRBCxipu5","slug":"finmath-xnpv-extended-net-present-value-calculator-a7ade54c","name":"finmath XNPV — Extended Net Present Value Calculator","description":"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.","url":"https://finmath.qzqh5rrbkz.workers.dev/v1/xnpv","method":"POST","headers":{},"bodySchema":{"type":"object","required":["rate","dates","cashflows"],"properties":{"rate":{"type":"number","description":"rate"},"dates":{"type":"array","description":"dates"},"cashflows":{"type":"array","description":"cashflows"}}},"responseSchema":{"type":"object","required":["result","meta"],"properties":{"meta":{"type":"object"},"result":{}}},"example":{"request":{"rate":0.05,"dates":["2024-01-01","2024-06-30","2025-01-01"],"cashflows":[-1000,500,600]},"response":{"meta":{"tool":"xnpv","disclaimer":"Deterministic calculation utility. Not financial, investment, or trading advice.","deterministic":true},"result":59.400076652016594}},"exampleRequest":{"rate":0.05,"dates":["2024-01-01","2024-06-30","2025-01-01"],"cashflows":[-1000,500,600]},"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_h7QNH6JS-2HcXvQdFxIAr","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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).","exampleAgentPrompt":"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%.","exampleUseCases":null,"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T18:50:22.864Z","isFirstParty":false}