Cashflow xnpv

cashflow-xnpv · version 1.0.0 · Financial calculations · free, no key needed

NPV of dated cash flows with the Excel XNPV 365-day exponent and an explicit valuation date.

Use when you need to: XNPV of dated cash flows · net present value with irregular dates · Excel XNPV function equivalent.

Decide before calling

Read the versioned contract and the supported scope below. Reuse cashflow-xnpv@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use cashflow-xnpv@1.0.0 for XNPV of dated cash flows. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "rate": "0.09",
  "cash_flows": [
    {
      "date": "2008-01-01",
      "amount": "-10000"
    },
    {
      "date": "2008-03-01",
      "amount": "2750"
    },
    {
      "date": "2008-10-30",
      "amount": "4250"
    },
    {
      "date": "2009-02-15",
      "amount": "3250"
    },
    {
      "date": "2009-04-01",
      "amount": "2750"
    }
  ]
}

Response:

{
  "result": {
    "xnpv": "2086.65",
    "valuation_date": "2008-01-01",
    "flows": 5
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "cashflow-xnpv",
  "version": "1.0.0",
  "input": {
    "rate": "0.09",
    "cash_flows": [
      {
        "date": "2008-01-01",
        "amount": "-10000"
      },
      {
        "date": "2008-03-01",
        "amount": "2750"
      },
      {
        "date": "2008-10-30",
        "amount": "4250"
      },
      {
        "date": "2009-02-15",
        "amount": "3250"
      },
      {
        "date": "2009-04-01",
        "amount": "2750"
      }
    ]
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/cashflow-xnpv/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"rate":"0.09","cash_flows":[{"date":"2008-01-01","amount":"-10000"},{"date":"2008-03-01","amount":"2750"},{"date":"2008-10-30","amount":"4250"},{"date":"2009-02-15","amount":"3250"},{"date":"2009-04-01","amount":"2750"}]}'

The machine-readable contract is at /v1/tools/cashflow-xnpv/versions/1.0.0.

CLI

node cli.mjs run cashflow-xnpv 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.