Cost of capital and discount rates
calculate_discount_rateCost-of-capital engine. Compute WACC, cost of equity (CAPM), cost of debt, unlevered/relevered beta, and country or size premiums from an explicit capital structure and market inputs. Use this to derive the discount rate an income-approach valuation needs; it returns a rate, not a valuation, so feed the result to calculate_dcf, or to calculate_residual for IFRS-basis measurement. Methods: wacc: equity_weight, debt_weight, cost_equity, cost_debt, tax_rate; capm: risk_free, beta, market_return; startup_capm: risk_free, beta, market_risk_premium, size_premium, illiquidity_premium; build_up: risk_free, equity_risk_premium, size_premium, industry_premium, specific_premium; currency_adjusted: base_rate, currency_risk_premium, country_risk_premium; country_risk: sovereign_yield, us_risk_free; esg: base_rate, esg_risk_premium, esg_opportunity_discount; portfolio_beta: weights, betas; ibr: risk_free, credit_spread, tenor_years. Supply exactly one method with its declared inputs (no defaults). An unknown method, a missing input, or an extra field returns an error envelope (code INVALID_ARGUMENT) instead of raising.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| beta | No | Equity beta (market = 1.0). | |
| betas | No | Asset/segment betas aligned with weights. | |
| method | Yes | Formula to apply; the tool description lists the exact inputs each value requires. | |
| weights | No | Weights that must sum to 1. | |
| tax_rate | No | Marginal corporate tax rate as a decimal. | |
| base_rate | No | Base rate before currency/country/ESG adjustment (decimal). | |
| cost_debt | No | Pre-tax cost of debt as a decimal. | |
| risk_free | No | Continuously-compounded risk-free rate (decimal). | |
| cost_equity | No | Cost of equity as a decimal (0.12 = 12%). | |
| debt_weight | No | Market-value weight of debt (decimal); with equity_weight must sum to 1. | |
| tenor_years | No | Tenor in years (>0). | |
| size_premium | No | Small-size premium (decimal). | |
| us_risk_free | No | US Treasury risk-free yield (decimal). | |
| credit_spread | No | Credit spread over the risk-free rate (decimal). | |
| equity_weight | No | Market-value weight of equity (decimal); with debt_weight must sum to 1. | |
| market_return | No | Expected market return (decimal). | |
| sovereign_yield | No | Sovereign bond yield (decimal). | |
| esg_risk_premium | No | ESG risk premium added to the base rate (decimal). | |
| industry_premium | No | Industry risk premium (decimal). | |
| specific_premium | No | Company-specific risk premium (decimal). | |
| equity_risk_premium | No | Equity risk premium (decimal). | |
| illiquidity_premium | No | Illiquidity premium (decimal). | |
| market_risk_premium | No | Market risk premium (decimal). | |
| country_risk_premium | No | Country risk premium (decimal). | |
| currency_risk_premium | No | Currency risk premium (decimal). | |
| esg_opportunity_discount | No | ESG opportunity discount subtracted from the base rate (decimal). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Error detail, present only when status='error'. | |
| steps | No | Ordered computation steps, when the method reports them. | |
| value | No | Primary result: a number for scalar methods, an object for valuation methods. | |
| method | No | Method or tool name that produced the result. | |
| status | Yes | 'ok' on success, 'error' on failure. | |
| ticker | No | Ticker the result pertains to, when applicable. | |
| assumptions | No | Inputs and assumptions used, echoed for traceability. | |
| formula_ref | No | Formula or standards reference for the method. | |
| data_timestamp | No | ISO-8601 UTC timestamp of the underlying data, when fetched. |