diff options
| author | Tyler <tyler@tylerhoang.xyz> | 2026-04-02 00:10:06 -0700 |
|---|---|---|
| committer | Tyler <tyler@tylerhoang.xyz> | 2026-04-02 00:10:06 -0700 |
| commit | 7a267bc3c28bc7a77e84eaa400667a7b4c0d5adf (patch) | |
| tree | 51b65d0ad1f1eaa1f276372a48cb319529284bb9 /services/valuation_service.py | |
| parent | 3806bd3b4d69917f3f5312acfa57bc4ee2886a49 (diff) | |
Refactor valuation models tab
Diffstat (limited to 'services/valuation_service.py')
| -rw-r--r-- | services/valuation_service.py | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/services/valuation_service.py b/services/valuation_service.py index 8559842..357c679 100644 --- a/services/valuation_service.py +++ b/services/valuation_service.py @@ -1,4 +1,4 @@ -"""Valuation engines for DCF and EV/EBITDA.""" +"""Valuation engines for DCF, EV/EBITDA, EV/Revenue, and simple multiple-based models.""" import numpy as np import pandas as pd @@ -158,3 +158,50 @@ def run_ev_ebitda( "implied_price_per_share": equity_value / shares_outstanding, "target_multiple_used": target_multiple, } + + +def run_ev_revenue( + revenue: float, + total_debt: float, + total_cash: float, + shares_outstanding: float, + target_multiple: float, +) -> dict: + """Derive implied equity value per share from an EV/Revenue multiple.""" + if not revenue or revenue <= 0: + return {} + if not shares_outstanding or shares_outstanding <= 0: + return {} + if not target_multiple or target_multiple <= 0: + return {} + + implied_ev = revenue * target_multiple + net_debt = (total_debt or 0.0) - (total_cash or 0.0) + equity_value = implied_ev - net_debt + + return { + "implied_ev": implied_ev, + "net_debt": net_debt, + "equity_value": equity_value, + "implied_price_per_share": equity_value / shares_outstanding, + "target_multiple_used": target_multiple, + "revenue_used": revenue, + } + + +def run_price_to_book( + book_value_per_share: float, + target_multiple: float, +) -> dict: + """Derive implied equity value per share from a P/B multiple.""" + if not book_value_per_share or book_value_per_share <= 0: + return {} + if not target_multiple or target_multiple <= 0: + return {} + + implied_price = float(book_value_per_share) * float(target_multiple) + return { + "implied_price_per_share": implied_price, + "target_multiple_used": float(target_multiple), + "book_value_per_share": float(book_value_per_share), + } |
