From 3806bd3b4d69917f3f5312acfa57bc4ee2886a49 Mon Sep 17 00:00:00 2001 From: Openclaw Date: Wed, 1 Apr 2026 23:32:01 -0700 Subject: Harden valuation edge cases --- services/valuation_service.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'services/valuation_service.py') diff --git a/services/valuation_service.py b/services/valuation_service.py index 6db4053..8559842 100644 --- a/services/valuation_service.py +++ b/services/valuation_service.py @@ -79,6 +79,13 @@ def run_dcf( growth_rate = historical_growth if historical_growth is not None else 0.05 base_fcf = float(historical[-1]) + if base_fcf <= 0: + return { + "error": ( + "DCF is not meaningful with zero or negative base free cash flow. " + "Use comps, EV/EBITDA, or adjust the model only after underwriting a credible FCF turnaround." + ) + } projected_fcfs = [] for year in range(1, projection_years + 1): -- cgit v1.3-2-g0d8e