Skip to content

Conversation

@majiayu000
Copy link

Summary

Fixes #431 - DCF analysis was producing unrealistic valuations (e.g., $16T for OKTA).

Root causes identified:

  • Terminal value calculation exploded when WACC-terminal growth spread was too small
  • No upper bounds on valuation relative to market cap
  • Bull scenario could reduce WACC to unrealistic levels

Changes:

  • Enforce minimum 4% spread between WACC and terminal growth
  • Cap terminal value at 50x market cap
  • Cap final valuation at 100x market cap
  • Set 7% WACC floor in scenario analysis
  • Cap base revenue growth at 30%
  • Fix transition stage to use proper cumulative growth calculation

Test plan

  • Added 17 new test cases covering all DCF valuation functions
  • Includes specific test for OKTA-like scenario ensuring no trillion-dollar valuations
  • All 60 tests pass (43 existing + 17 new)

- Add minimum 4% spread between WACC and terminal growth rate
- Cap terminal value at 50x market cap
- Cap final valuation at 100x market cap
- Set 7% WACC floor in scenario analysis
- Cap base revenue growth at 30%
- Fix transition stage FCF calculation to use cumulative growth
- Add comprehensive test suite for DCF valuation functions
Copy link

@biplavbarua biplavbarua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 📉

The safeguards here are spot on for a production DCF model.

  1. Spread Enforcement: wacc - terminal_growth >= 0.04 is the critical fix. Without this, close values (e.g., 9% WACC vs 8.9% growth) cause the terminal value denominator to approach zero, resulting in the reported $16T valuations.
  2. Ceilings: The 50x terminal / 100x total market cap guardrails are a good practical stop-gap against data outliers.

This should stabilize the valuation_agent outputs significantly.

Copy link

@biplavbarua biplavbarua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
The introduction of the 50x Market Cap ceiling for Terminal Value and the 100x ceiling for the total DCF valuation provides a necessary upper bound, preventing outlier explosions in the agent's logic.
Critically, enforcing a minimum spread of 4% between WACC and terminal growth is a standard robustification technique to avoid the asymptotic singularity when g approaches WACC.
This significantly improves the stability of the valuation models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DCF analysis gives $16T valuation for $OKTA

2 participants