{"record":{"id":"75160c6dca55a1fd","repo":"HKUDS/Vibe-Trading","slug":"terminal-value-terminal-growth-growth-r-must","errorCode":null,"errorMessage":"terminal_value: terminal_growth ({growth!r}) must be strictly less than WACC ({wacc_rate!r}); at or above WACC the Gordon-growth terminal value is negative or infinite, not merely a large number. Lower the growth assumption or check the WACC build.","messagePattern":"terminal_value: terminal_growth \\((.+?)\\) must be strictly less than WACC \\((.+?)\\); at or above WACC the Gordon-growth terminal value is negative or infinite, not merely a large number\\. Lower the growth assumption or check the WACC build\\.","errorType":"validation","errorClass":"ValuationError","httpStatus":null,"severity":"error","filePath":"agent/src/quantlib/valuation/dcf.py","lineNumber":772,"sourceCode":"            happens to equal ``-final_year_fcff`` exactly, which makes the\n            implied-growth reverse-solve's denominator zero.\n    \"\"\"\n    _require_assumption(terminal_growth, \"terminal_growth\", \"terminal_value\")\n    _require_assumption(exit_multiple, \"exit_multiple\", \"terminal_value\")\n\n    final_year_fcff = _require_finite(final_year_fcff, \"final_year_fcff\", \"terminal_value\")\n    terminal_year_ebitda = _require_finite(\n        terminal_year_ebitda, \"terminal_year_ebitda\", \"terminal_value\"\n    )\n    wacc_rate = _require_finite(wacc_rate, \"wacc_rate\", \"terminal_value\")\n\n    if wacc_rate <= -1.0:\n        raise ValuationError(\n            f\"terminal_value: wacc_rate must exceed -1, got {wacc_rate!r}\"\n        )\n    growth = _require_finite(terminal_growth.value, \"terminal_growth.value\", \"terminal_value\")\n    if growth >= wacc_rate:\n        raise ValuationError(\n            f\"terminal_value: terminal_growth ({growth!r}) must be strictly \"\n            f\"less than WACC ({wacc_rate!r}); at or above WACC the Gordon-growth \"\n            \"terminal value is negative or infinite, not merely a large number. \"\n            \"Lower the growth assumption or check the WACC build.\"\n        )\n    if terminal_year_ebitda <= 0.0:\n        raise ValuationError(\n            f\"terminal_value: terminal_year_ebitda must be positive to derive \"\n            f\"an implied EV/EBITDA multiple, got {terminal_year_ebitda!r}\"\n        )\n    multiple = _require_finite(exit_multiple.value, \"exit_multiple.value\", \"terminal_value\")\n    if multiple <= 0.0:\n        raise ValuationError(\n            f\"terminal_value: exit_multiple.value must be positive, got {multiple!r}\"\n        )\n\n    next_year_fcff = final_year_fcff * (1.0 + growth)\n    perpetuity_tv = next_year_fcff / (wacc_rate - growth)","sourceCodeStart":754,"sourceCodeEnd":790,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/quantlib/valuation/dcf.py#L754-L790","documentation":"terminal_value() refuses terminal growth >= WACC: with g at or above the discount rate the Gordon-growth TV = EBITDA*(1+g)/(wacc-g) is negative or infinite, so the library rejects the assumption rather than emitting a meaningless huge number.","triggerScenarios":"terminal_value(wacc_rate=0.07, terminal_growth=Rate(0.07)) or growth 0.09 vs wacc 0.07; WACC computed too low relative to a growth assumption of 2-3%.","commonSituations":"Optimistic perpetuity growth (3%) with a low WACC from a low beta/rate environment; unit mismatch (wacc as 7 vs growth 0.03); widening spreads where the WACC estimate drops below long-run nominal growth.","solutions":["Lower terminal growth to below WACC (commonly 2-2.5% cap) or revisit the WACC build upward","Check for unit mismatch: both must be decimals (0.07 vs 0.03, not 7 vs 0.03)","Add a pre-flight assertion g < wacc - margin in the modeling pipeline"],"exampleFix":"# before\nterminal_value(..., wacc_rate=0.065, terminal_growth=Rate(0.07))\n\n# after\nterminal_value(..., wacc_rate=0.09, terminal_growth=Rate(0.025))","handlingStrategy":"validation","validationCode":"MARGIN = 0.005\nassert terminal_growth.value < wacc_rate - MARGIN, f'g={terminal_growth.value} must be below wacc={wacc_rate} - {MARGIN}'\nterminal_value(..., terminal_growth=terminal_growth, wacc_rate=wacc_rate)","typeGuard":"def growth_safe_for_gordon(g: float, wacc: float, margin: float = 0.005) -> bool:\n    return g < wacc - margin","tryCatchPattern":"try:\n    terminal_value(...)\nexcept ValuationError as e:\n    if 'strictly less than WACC' in str(e):\n        return terminal_value(..., terminal_growth=Rate(min(g, wacc - 0.005)), wacc_rate=wacc)\n    raise","preventionTips":["Cap perpetuity growth at ~2-2.5% or below WACC minus a margin","Re-run the WACC build when rate assumptions change materially","Verify both g and wacc are decimals, never percents"],"tags":["valuation","terminal-value","gordon-growth","gordon-growth-guard"],"backgroundTag":"growth-at-or-above-discount-rate","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}