Module: lib/dcf_engine.py
The core computation engine for the FCFF valuation model. Accepts pre-computed 10-year schedules from the curve shapes library and produces a complete valuation.
Key function
dcf_valuation()
The main entry point. Runs the full DCF: 10-year projection, terminal value, and equity bridge.
Schedule inputs (from growth-and-profitability via curve_shapes.py):
growth_schedule— 10-element list of revenue growth rates (year 1–10)margin_schedule— 10-element list of operating margins (year 1–10)s2c_schedule— 10-element list of sales-to-capital ratios (year 1–10)coc_schedule— 10-element list of cost of capital rates (year 1–10)
revenue,ebit,book_equity,book_debt,cashminority_interests,non_operating_assetsshares_outstanding,stock_priceeffective_tax_rate,marginal_tax_rate,riskfree_rate
total_option_value,has_options— from employee-options- R&D and lease adjustment deltas — from r-and-d-converter and lease-converter
- Terminal cost of capital, terminal ROIC, failure probability, reinvestment lag, tax convergence, NOL carryforward, risk-free rate override, growth rate override, trapped cash
How schedules flow through
When schedules are provided, they take precedence over the legacy scalar inputs:revenue_growth_next_year, revenue_growth_years_2_5). This ensures backward compatibility with older runs.