fintech-algorithms
Using a coding agent? Give it the skill: npx skills add IslamBaraka90/Fintech-Algorithms-Library What it does →

Free-Cash-Flow DCF

Install and import#

bash
npm install fintech-algorithms
ts
import { freeCashFlowDcf } from "fintech-algorithms/fundamental-analysis-and-valuation/intrinsic-valuation/free-cash-flow-dcf";

Signature#

freeCashFlowDcf(data)

Discounts an explicit free-cash-flow-to-the-firm forecast at the WACC and adds a growing-perpetuity terminal value built from the last forecast period, then bridges the resulting enterprise value to equity value and to value per diluted share.

Parameters#

NameTypeNotes
data{ fcff: number[]; wacc: number; terminal_growth: number; cash_and_non_operating_assets: number; debt: number; preferred_equity: number; noncontrolling_interest: number; diluted_shares: number }fcff holds the explicit forecast, one finite number per period, discounted at periods 1 through n. wacc is the discount rate and terminal_growth grows the final fcff entry into the terminal cash flow. The bridge takes cash_and_non_operating_assets less debt, preferred_equity and noncontrolling_interest, and diluted_shares divides equity value. Other keys in the record are not read.

Returns#

{ state: string; method: string; schedule: { period: number; fcff: number; discount_factor: number; present_value: number }[]; pv_explicit_fcff: number; terminal_fcff: number; terminal_value: number; terminal_discount_factor: number; pv_terminal_value: number; terminal_value_share: number; enterprise_value: number; net_equity_bridge: number; equity_value: number; intrinsic_value_per_share: number }

A schedule row per forecast period carrying its discount_factor and present_value, alongside pv_explicit_fcff, the terminal block (terminal_fcff, terminal_value, terminal_discount_factor, pv_terminal_value), and the bridge (enterprise_value, net_equity_bridge, equity_value, intrinsic_value_per_share). terminal_value_share is the terminal present value over enterprise value, emitted as 0 when enterprise value is 0.

Errors#

  • When data is absent, an array, or not an object — throws Error
  • When fcff is not an array holding at least one finite number — throws Error
  • When wacc is not strictly between 0 and 1 — throws Error
  • When terminal_growth is at or below -1, or at or above wacc — throws Error
  • When any bridge item is not a finite number, or diluted_shares is not positive — throws Error

Complexity: time O(n), space O(n).

Worked example#

executed Captured by running this function on the input its own test provides. Real output of real code — but not asserted against a published figure.

Input#

data
{
  "valuation_date": "2026-08-04",
  "currency": "USD",
  "unit_scale": "millions except per-share",
  "fcff": [90, 100, 112, 124, 136],
  "wacc": 0.09,
  "terminal_growth": 0.03,
  "cash_and_non_operating_assets": 120,
  "debt": 450,
  "preferred_equity": 20,
  "noncontrolling_interest": 10,
  "diluted_shares": 100
}

Call#

freeCashFlowDcf(data)

Returns#

object with 13 fields: state, method, schedule, pv_explicit_fcff, terminal_fcff, terminal_value, terminal_discount_factor, pv_terminal_value, …

{
  "state": "valued",
  "method": "fcff-enterprise-dcf",
  "schedule": [
    {
      "period": 1,
      "fcff": 90,
      "discount_factor": 0.9174311926605504,
      "present_value": 82.56880733944953
    },
    {
      "period": 2,
      "fcff": 100,
      "discount_factor": 0.84167999326656,
      "present_value": 84.167999326656
    },
    {
      "period": 3,
      "fcff": 112,
      "discount_factor": 0.772183480061064,
      "present_value": 86.48454976683917
    }
  ],
  "pv_explicit_fcff": 429.45675114160395,
  "terminal_fcff": 140.08,
  "terminal_value": 2334.666666666667,
  "terminal_discount_factor": 0.6499313862983452,
  "pv_terminal_value": 1517.3731432112036,
  "terminal_value_share": 0.7794071519102238,
  "enterprise_value": 1946.8298943528075,
  "net_equity_bridge": -360,
  "equity_value": 1586.8298943528075,
  "intrinsic_value_per_share": 15.868298943528075
}

Other exports#

This module also exports calculate, dividendDiscountModel, gordonGrowthModel, residualIncomeModel, economicValueAdded. Every module additionally exports run as an alias of its primary function, and a meta object carrying its catalog id, domain, family, shape and article URL.

Diagrams#

Free-Cash-Flow DCF — article hero
Free-Cash-Flow DCF — model boundaries
Free-Cash-Flow DCF — reconciliation bridge
Free-Cash-Flow DCF — sensitivity map
Free-Cash-Flow DCF — system map
Free-Cash-Flow DCF — valuation timeline

How it works#

This page states the contract — how to call it correctly. The article explains the concept: why it works, and where it breaks.

Read the article →

References#

The rest of the Intrinsic Valuation family#