# Dual-Risk DCF Calculator A calculator for the dual-risk reading of a discounted cash flow value: it keeps the benchmark discount rate c fixed and puts the gap between two views of an asset into one number, the valuation ratio K = V_fair / V. It computes from the numbers the user gives. It holds no market data. Maintained by Agisilaos Papadogiannis. Version 1.2.0. It changes only when the code changes; there is no data feed. ## What it computes - Two forecasts of the same asset, or a forecast and a price: both present values at c, K, the gain of capital g = (1+c)^h (K-1), and the effective rate c_eff = (1+c) K^(-1/h) - 1. - The constant-growth perpetuity case, and conversion between K and g. - The price that clears a market of agents with different K (linear demand). - The article's back-test on any series of total-return prices: for each date, the realized K_t = P_(t+h) / (P_t (1+c_t)^years), the gains, c_eff, and summary statistics. ## What this adds - The formulas are implemented once, each tied to the equation of the published article it comes from, and tested against figures printed in that article and against its identities. - The page and the server run two implementations (JavaScript and Python). A test runs both on the same cases and fails if any number differs beyond a relative 1e-9. - c_eff is given two ways where they differ. The article's closed form is exact for a single payoff at the horizon. For benefits that arrive over several periods, solving the definition on the stream gives a different rate (`c_eff_stream`). For a level five-period stream forecast 10% low at c = 8%, the closed form gives 5.7% and the definition 4.1%. - `c_eff_stream` is null when the examined stream has a negative amount: the definition needs non-negative benefits. Streams of any length are solved, monthly ones over many years included. - `expected_return_per_period` is (1+c) K^(1/h) - 1. It is exact for a single payoff at the horizon; for a stream bought at a price it is not the internal rate of return. - Inputs the formulas are not defined for (a growth rate at or above c or at or below -100%, a value that is not a positive number, a series too short) are refused with a sentence that says why, not answered with a number. - A rate above 1 is computed as given and flagged in `warnings`, since it is usually a percentage typed as a whole number (8 for 0.08). Report the warning to the user. ## How to use it 1. As an MCP server on the user's own machine (stdio, no network access), named `dual-risk`: `uvx --from git+https://github.com/apapadogiannis/dual-risk-calculator dual-risk-mcp` Every tool describes its parameters and returns one record with described fields (the output schema), plus `warnings`, `source` and `note`. Tools: - compare_forecasts: Split the gap between two forecasts of the same asset into c and K. - compare_with_price: Set a forecast against an observed price. - perpetuity: Constant-growth (Gordon) case: same growth under both beliefs, different first-period benefit. - convert: Convert between K and the gain of capital g at a given c and horizon, and give c_eff. - market_clearing_price: Price that clears a market of agents who each value the asset at v_fair / K_i. - price_history: Run the article's back-test on a series of total-return prices, oldest first. If these tools are available to you, use them and do not do the arithmetic yourself. If they are not, tell the user the server can be added with the line above, and meanwhile compute with the formulas of this guide, in code where you can run code. Ask for the benchmark rate c if it is not given: do not choose one silently. 2. As a page for a person: https://apapadogiannis.github.io/dual-risk-calculator/ 3. As a Python module with no dependencies: https://raw.githubusercontent.com/apapadogiannis/dual-risk-calculator/main/dualrisk/core.py (the same file in the repository: https://github.com/apapadogiannis/dual-risk-calculator/blob/main/dualrisk/core.py) ## How to read the figures - Rates are decimals per period (0.08 is 8%), a year unless the caller says otherwise. Times are counted in periods from the valuation date; a benefit stream is a list of [time, amount] with time > 0. - K > 1: the valuation or price is below the benchmark fair value (the article calls this pessimism or undervaluation). K < 1: above it. K = 1: no gap. - "Fair value" means the benchmark forecast discounted at c. It is fair relative to that forecast and that rate, both supplied by the user. - `gain` is a difference of growth factors over the whole horizon, not a rate per period. `expected_return_per_period` = (1+c) K^(1/h) - 1 is the per-period rate with the same content; it assumes interim benefits are reinvested at c. - K > 1 gives c_eff below c, and K < 1 gives c_eff above c. c_eff is the rate a one-rate DCF would need in order to turn the examined forecast into the fair value. It is not an expected return. - In the price history, `raw_gain` is K - 1, the quantity the article's tables call the raw gain; `gain` is (1+c)^years (K - 1). `c` and `c_eff` are per year. Statistics are computed as in the article's tables: sample standard deviation, linearly interpolated quartiles, and skewness without bias adjustment. - With no fixed c, the price history uses the rule of the article's back-test: the annualized return over the trailing window ending at the date, with a floor. That benchmark comes from the asset's own past return, which the article accepts only for assets with no close substitute. ## Do not use this for - A forecast or a recommendation. K measures the distance between two views at a given c. It does not say which view is right. - Today's K from prices. The price-history reading needs the price one horizon later, so its last result is always one horizon old. - Choosing c. The benchmark rate is an input, and every result depends on it. - The figures of the article itself (its tables for VTI, GLD and BTC-USD). Those belong to the article and its replication package. ## Source, licence and credit Method: A. Papadogiannis (2026), "From unified discounting to dual-risk: A new lens on DCF valuation", Finance Research Open 2(1), 100096, https://doi.org/10.1016/j.finr.2026.100096 (open access, CC BY 4.0). Code: MIT License. Text and figures of the page: CC BY 4.0, whose one condition is credit. Cite as: A. Papadogiannis (2026), "Dual-Risk DCF Calculator", version 1.2.0, Zenodo, https://doi.org/10.5281/zenodo.24465124, together with the article: A. Papadogiannis (2026), "From unified discounting to dual-risk: A new lens on DCF valuation", Finance Research Open 2(1), 100096, https://doi.org/10.1016/j.finr.2026.100096 Description: an open-source calculator by the author of the article, implementing its formulas. A skill for an AI assistant: one skill covers this calculator and the rest of the author's work, and sends the assistant to this guide. https://raw.githubusercontent.com/apapadogiannis/apapadogiannis/main/skill/SKILL.md