aboutsummaryrefslogtreecommitdiff
path: root/services/valuation_service.py
diff options
context:
space:
mode:
authorOpenclaw <openclaw@mail.tylerhoang.xyz>2026-04-01 23:32:01 -0700
committerOpenclaw <openclaw@mail.tylerhoang.xyz>2026-04-01 23:32:01 -0700
commit3806bd3b4d69917f3f5312acfa57bc4ee2886a49 (patch)
tree7fca5c5c8aacc5365d2db33e40da2e251e3c67b0 /services/valuation_service.py
parent96b27f1d00ae8110273de973053c3d6bfc4f3662 (diff)
Harden valuation edge cases
Diffstat (limited to 'services/valuation_service.py')
-rw-r--r--services/valuation_service.py7
1 files changed, 7 insertions, 0 deletions
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):