# Dcf valuation compute

`dcf-valuation-compute` · version 1.0.0 · Financial calculations · free, no key needed

Enterprise and equity value from forecast free cash flows with a Gordon or exit-multiple terminal value.

**Use when you need to: discounted cash flow valuation · DCF with terminal value · Gordon growth terminal value.**

## Decide before calling

Read the [versioned contract](/v1/tools/dcf-valuation-compute/versions/1.0.0) and the supported scope below. Reuse `dcf-valuation-compute@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 `dcf-valuation-compute@1.0.0` for discounted cash flow valuation. 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

- discounted cash flow valuation
- DCF with terminal value
- Gordon growth terminal value
- enterprise value from free cash flow forecast
- exit multiple terminal value DCF
- mid-year convention DCF
- equity value from enterprise value and net debt
- terminal value as a share of enterprise value

## Not supported

- estimating WACC, beta or the cost of equity
- forecasting free cash flows from financial statements
- terminal value discounted at N minus one half under the mid-year convention
- minority interests, preferred equity, leases or tax adjustments in the equity bridge

## Behavior

- Inputs: cash_flows (forecast free cash flows for years 1 to N, N from 1 to 200 decimal strings, first flow is year 1, any sign), discount_rate (annual rate as a decimal fraction, greater than -1 and at most 100), terminal (required object: either {method: gordon-growth, growth_rate} with growth_rate a decimal greater than -1 and at most 100, or {method: exit-multiple, multiple, terminal_metric} with multiple a decimal from 0 to 1000000 and terminal_metric any decimal, for example the year-N EBITDA), mid_year (boolean, default false), net_debt (optional decimal, negative means net cash), scale (0 to 12, default 2, for amounts), rate_scale (0 to 12, default 10, for terminal_value_share) and rounding (default half-up). There is no year-0 flow: the valuation date is the start of year 1.
- Discounting: the flow of year t (t = 1 .. N) is discounted by (1+r)^t (end-of-year convention, mid_year false) or by (1+r)^(t - 0.5) (mid-year convention, mid_year true), with r = discount_rate; (1+r)^(t-0.5) is computed as (1+r)^(t-1) times the square root of (1+r). pv_cash_flows[t-1] = cash_flow_t / that factor.
- Terminal value at the end of year N: gordon-growth TV = cash_flow_N * (1+g) / (r - g), where cash_flow_N is the LAST listed flow and g = growth_rate (the next flow is FCF_N*(1+g); it is not built from FCF_N alone); it requires g < r, otherwise not_computable (details.reason growth_not_below_rate). exit-multiple TV = multiple * terminal_metric.
- Terminal value discounting: under BOTH methods and regardless of mid_year, pv_terminal_value = terminal_value / (1+r)^N (discounted N whole years, not N - 0.5). This is a stated convention of this tool; practitioners who discount a Gordon terminal value at N - 0.5 under the mid-year convention must adjust the result themselves (multiply pv_terminal_value by (1+r)^0.5).
- Results: sum_pv_cash_flows = sum of pv_cash_flows; enterprise_value = sum_pv_cash_flows + pv_terminal_value; terminal_value_share = pv_terminal_value / enterprise_value (a fraction, rounded to rate_scale; it can be negative or above 1 when flows or enterprise value are negative) or null when enterprise_value is exactly 0; equity_value = enterprise_value - net_debt, or null when net_debt is not supplied. Nothing else (tax, minority interests, cash) is deducted.
- Exact path: each discounted flow, the terminal value and the discounted terminal value is computed with an absolute error below 1e-33 and rounded half-even to 30 fractional digits (so exact results such as 110/1.1 = 100 are recovered exactly); sums and differences of these values are exact; every output is then rounded once from the unrounded value to scale (or rate_scale for the share) with the rounding mode. The printed pv_cash_flows can therefore differ from the printed sum_pv_cash_flows by units of the last digit.
- If any discounted flow, terminal value, discounted terminal value or enterprise value reaches 1e20 in magnitude the result is not_computable (details.reason overflow); this happens only with a negative discount rate or extreme inputs.
- More than 200 cash flows, or a decimal string longer than 64 UTF-8 bytes, is limit_exceeded, checked before parsing. Percent values are not accepted: 0.1 means 10 percent per year. Output pv_cash_flows always has one entry per input flow.
- Every rounded output is rounded exactly once from the unrounded value using the rounding mode: half-up (ties away from zero, the default), half-even, half-down (ties toward zero), up (away from zero), down (toward zero), ceiling, floor. Amount outputs print exactly scale fractional digits and rate-like outputs exactly rate_scale fractional digits; a result that rounds to zero prints without a minus sign (never '-0.00').
- Decimal string fields (amounts, rates) must match ^-?(0|[1-9][0-9]*)(\.[0-9]+)?$ with at most 20 integer digits and at most 20 fractional digits; a JSON number, exponent form, leading plus, surrounding spaces, percent sign, missing integer part or trailing dot is invalid_input. Rates are decimal fractions (0.065 means 6.5 percent; "6.5" means 650 percent). A decimal string longer than 64 UTF-8 bytes is limit_exceeded, checked before parsing.
- Disclaimer: arithmetic calculation only; not financial, tax, legal, or investment advice.

## Input

- `cash_flows` (array of string, required): min items 1; max items 200; each max length 64; each pattern `^-?(0|[1-9][0-9]*)(\.[0-9]+)?$`
- `discount_rate` (string, required): max length 64; pattern `^-?(0|[1-9][0-9]*)(\.[0-9]+)?$`
- `terminal` (object or object, required)
- `mid_year` (boolean, optional)
- `net_debt` (string, optional): max length 64; pattern `^-?(0|[1-9][0-9]*)(\.[0-9]+)?$`
- `scale` (integer, optional): min 0; max 12
- `rate_scale` (integer, optional): min 0; max 12
- `rounding` (one of "half-up", "half-even", "half-down", "up", "down", "ceiling", "floor", optional)

## Output

- `pv_cash_flows` (array of string, required): min items 1; max items 200; each max length 64; each pattern `^-?(0|[1-9][0-9]*)(\.[0-9]+)?$`
- `sum_pv_cash_flows` (string, required): max length 64; pattern `^-?(0|[1-9][0-9]*)(\.[0-9]+)?$`
- `terminal_value` (string, required): max length 64; pattern `^-?(0|[1-9][0-9]*)(\.[0-9]+)?$`
- `pv_terminal_value` (string, required): max length 64; pattern `^-?(0|[1-9][0-9]*)(\.[0-9]+)?$`
- `enterprise_value` (string, required): max length 64; pattern `^-?(0|[1-9][0-9]*)(\.[0-9]+)?$`
- `terminal_value_share` (string or null, required): max length 64; pattern `^-?(0|[1-9][0-9]*)(\.[0-9]+)?$`
- `equity_value` (string or null, required): max length 64; pattern `^-?(0|[1-9][0-9]*)(\.[0-9]+)?$`

## Limits

- max items: 200
- max string bytes: 64

## Example

Request input:

```json
{
  "cash_flows": [
    "8000",
    "9200",
    "10000",
    "12000",
    "14500"
  ],
  "discount_rate": "0.08",
  "terminal": {
    "method": "exit-multiple",
    "multiple": "0",
    "terminal_metric": "0"
  }
}
```

Response:

```json
{
  "result": {
    "pv_cash_flows": [
      "7407.41",
      "7887.52",
      "7938.32",
      "8820.36",
      "9868.46"
    ],
    "sum_pv_cash_flows": "41922.06",
    "terminal_value": "0.00",
    "pv_terminal_value": "0.00",
    "enterprise_value": "41922.06",
    "terminal_value_share": "0.0000000000",
    "equity_value": null
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "dcf-valuation-compute",
  "version": "1.0.0",
  "input": {
    "cash_flows": [
      "8000",
      "9200",
      "10000",
      "12000",
      "14500"
    ],
    "discount_rate": "0.08",
    "terminal": {
      "method": "exit-multiple",
      "multiple": "0",
      "terminal_metric": "0"
    }
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/dcf-valuation-compute/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"cash_flows":["8000","9200","10000","12000","14500"],"discount_rate":"0.08","terminal":{"method":"exit-multiple","multiple":"0","terminal_metric":"0"}}'
```

The machine-readable contract is at [/v1/tools/dcf-valuation-compute/versions/1.0.0](/v1/tools/dcf-valuation-compute/versions/1.0.0).

### CLI

```sh
node cli.mjs run dcf-valuation-compute 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Cashflow npv](/tools/cashflow-npv): NPV of equally spaced cash flows, time-0 or Excel time-1, with inflow PV, outflow PV and profitability index.
- [Cashflow payback period](/tools/cashflow-payback-period): Payback period of periodic cash flows with linear interpolation, optional discounting and the cumulative path.
- [Cashflow xnpv](/tools/cashflow-xnpv): NPV of dated cash flows with the Excel XNPV 365-day exponent and an explicit valuation date.
- [Growth cagr compute](/tools/growth-cagr-compute): CAGR from start and end values or a total return over years or dates, with a sub-year warning.
- [Bond price from yield](/tools/bond-price-from-yield): Clean price, dirty price and accrued interest per 100 of a fixed-coupon bond from its yield (Excel PRICE, SIA).
- [Cashflow irr](/tools/cashflow-irr): IRR of equally spaced cash flows with every root reported, the chosen root named and no-solution cases signalled.
