Hermes Plant logo

Hermes Plant

Agent Action Safety for autonomous tools

Open navigation

CashflowLens

$0.20/callPer-analysis

NPV, IRR, XIRR & DCF valuation in a single call.

POST /api/agent-services/cashflowlens/analyze
financeirrai-agentsx402dcfxirrnpvmoiccash-flow-analysiscashflowvaluation

Answer-engine brief

Canonical answer for CashflowLens

Pricing
Direct answer
CashflowLens is a deterministic x402 API for AI agents. NPV, IRR, XIRR & DCF valuation in a single call.
When to use
Use it when an agent needs a repeatable computed result with evidence instead of asking an LLM to improvise a number or risk decision.
Inputs
cashflows, discountRate, periodsPerYear, nav, dcf
Outputs
service, requestId, mode, summary, dcf
Pricing
$0.20 per call, paid over x402 in USDC on Base. No API key is required.
Citation target
https://hermesplant.com/agent-services/cashflowlens

What it does

Deterministic cash flow analysis and return analytics in one call: NPV, IRR (periodic), XIRR (dated), MOIC / DPI / TVPI, payback period, plus an optional DCF valuation (enterprise value, equity value, implied share price) with Gordon-growth or exit-multiple terminal value. Pure math from caller-provided cashflows — no market-data feed, no fabrication. Every metric is accompanied by evidence-backed findings and a signed response receipt.

  • Solve IRR / XIRR from any cashflow series
  • NPV + DCF (Gordon-growth or exit-multiple)
  • MOIC / DPI / TVPI and payback period

Example request

POST /api/agent-services/cashflowlens/analyze

{
  "cashflows": [
    -1000000,
    50000,
    60000,
    70000,
    1200000
  ],
  "discountRate": 0.08,
  "periodsPerYear": 1,
  "nav": 0
}

Example response (HTTP 200)

Deterministic — the same inputs always return the same audited output.

{
  "service": "cashflowlens",
  "requestId": "cfl-1a2b3c4d",
  "mode": "periodic",
  "summary": {
    "totalIn": 1380000,
    "totalOut": 1000000,
    "net": 380000,
    "npv": 162512.34,
    "irrPerPeriod": 0.1287,
    "irrAnnual": 0.1287,
    "xirr": null,
    "moic": 1.38,
    "dpi": 1.38,
    "tvpi": 1.38,
    "paybackPeriod": 3.68
  },
  "dcf": null,
  "findings": [
    {
      "rule": "mode",
      "severity": "info",
      "why": "Whether returns were computed on dated (XIRR) or periodic (IRR) cashflows.",
      "evidence": "mode=periodic cashflows=5 periodsPerYear=1",
      "fix": null
    }
  ],
  "cashflowCount": 5
}

Input schema

Top-level request fields. Nested shapes are shown in the example above and the OpenAPI spec.

FieldTypeRequiredDescription
cashflowsarrayYesSeries of cashflows. Each item is a number (periodic, t=0,1,2,...) OR an object {amount, date?, label?}. Outflows negative, inflows positive. If ANY item has a date, dated/XIRR mode is used.
discountRatenumberAnnual rate for NPV (e.g. 0.10). Omit to skip NPV.
periodsPerYearnumberPeriods per year to annualize a periodic IRR (default 1; e.g. 12 for monthly, 4 for quarterly).
navnumberResidual / net asset value, used for TVPI = (distributions + nav) / paid-in.
dcfobjectOptional DCF valuation inputs.

How to call it over x402

  1. 1. Send the request. The first unpaid call returns HTTP 402 with an x402 payment challenge — $0.20, USDC on Base, and the recipient.
  2. 2. Pay per call. Your x402 client signs the USDC payment and retries automatically — no API key, no account, no subscription. New to x402?
  3. 3. Read the result. HTTP 200 returns the computed values plus evidence-backed findings.

With the x402 fetch client (Node / TypeScript)

import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.AGENT_WALLET_KEY);
const pay = wrapFetchWithPayment(fetch, account); // USDC on Base

const res = await pay("https://hermesplant.com/api/agent-services/cashflowlens/analyze", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
  "cashflows": [
    -1000000,
    50000,
    60000,
    70000,
    1200000
  ],
  "discountRate": 0.08,
  "periodsPerYear": 1,
  "nav": 0
}),
});

const result = await res.json();

Inspect the 402 with curl

curl -i -X POST https://hermesplant.com/api/agent-services/cashflowlens/analyze \
  -H "content-type: application/json" \
  -d '{"cashflows":[-1000000,50000,60000,70000,1200000],"discountRate":0.08,"periodsPerYear":1,"nav":0}'
# → HTTP/1.1 402 Payment Required  (x402 challenge: price, USDC asset, Base network, recipient)
# → sign the USDC-on-Base payment and retry to receive HTTP 200

Prefer no wallet? Get a free API key (250 calls/mo) and send it as X-API-Key instead of signing an x402 payment — the same call, no crypto, ideal for looping over many records.

Prefer zero code? This endpoint is also exposed as a tool on the Hermes Plant MCP server, so an MCP-capable agent can call it with its own x402 wallet.

Other agent services

Agent Action Safety Quick Gate$0.01

A one-cent safety gate for every consequential agent action.

Agent Action Safety Loop$0.25

Score, triage, receipt, and status in one agent-safety workflow.

x402 Demand Provenance Check$0.05

Separate candidate demand from owner-funded and duplicate x402 activity.

Assurance Attest$0.05

A signed, verifiable receipt for every action your agent takes.

Payment Policy Decision API$0.05

Decide whether an agent should pay before it signs.

Evidence Verification API$0.05

Verify the evidence bundle before trusting a paid agent result.

MCP Server Risk Analyzer$0.05

Score an MCP server before your agent installs it.

DestructGuard Command Score$0.10

Catch destructive agent commands before they run.

ReviewQueue Agent Submit$0.25

Route risky agent actions to human approval.

EmailGuard$0.02

Validate & normalize every contact record your agent touches.

WalletGuard$0.10

Per-wallet AML screening inside your agent's loop.

WaterfallLens$0.25

LP/GP distribution waterfalls, solved exactly.

OptionLens$0.25

Black-Scholes option pricing with the full Greeks.

BondLens$0.25

Yield, duration, convexity & loan amortization.

PortfolioGuard$0.15

Portfolio risk scored straight from holdings.

DealAnalyzer$0.25

Full deal underwriting — DCF, returns, sensitivity & waterfall in one call.

Agent Spend Assurance$0.25

One signed preflight for an autonomous x402 payment: WalletGuard counterparty screening, Payment Policy challenge validation, and structured evidence verification.

Investment Evidence Bundle$0.25

CashflowLens return and DCF analytics plus PortfolioGuard concentration and risk scoring in one paid call, with structured internal evidence and a tamper-evident signed receipt.

Start first paid call stepsAPI docs← All agent services

Need a calculator that isn’t here yet? contact@hermesplant.com