advisor-dashboards
Design, build, and optimize dashboards for RIA practice management with AUM tracking, revenue analytics, and KPI frameworks. Use…
Compute and compare investment return metrics including TWR, MWR (dollar-weighted IRR on portfolio cash flows), CAGR, and annualized returns. Use when the user asks about portfolio performance calculation, comparing manager returns, linking sub-period returns, understanding why
Claude Code
$ npx -y skills add JoelLewis/finance_skills --skill return-calculations --agent claude-code
Codex
$ npx skills add JoelLewis/finance_skills --skill return-calculations -a codex -y
Cursor
$ npx skills add JoelLewis/finance_skills --skill return-calculations -a cursor -y
Gemini CLI
$ npx skills add JoelLewis/finance_skills --skill return-calculations -a gemini-cli -y
GitHub Copilot
$ npx skills add JoelLewis/finance_skills --skill return-calculations -a github-copilot -y
OpenCode
$ npx skills add JoelLewis/finance_skills --skill return-calculations -a opencode -y
Windsurf
$ npx skills add JoelLewis/finance_skills --skill return-calculations -a windsurf -y
name: return-calculations description: "Compute and compare investment return metrics including TWR, MWR (dollar-weighted IRR on portfolio cash flows), CAGR, and annualized returns. Use when the user asks about portfolio performance calculation, comparing manager returns, linking sub-period returns, understanding why different return methods give different numbers, converting returns across time periods, or computing the IRR of an investor's own contributions and withdrawals. Also trigger when users mention 'how much did I make', 'annual return', 'compound growth', 'dollar-weighted vs time-weighted', 'what was my rate of return', 'geometric vs arithmetic mean', 'log returns', or ask about the effect of cash flows on reported returns. For project or loan IRR, NPV, and generic 'solve for the rate' problems, use time-value-of-money instead."
$$R = \frac{V_{end} - V_{begin} + D}{V_{begin}}$$
where `D` = distributions (dividends, interest) received during the period. If `V_end` already reflects reinvested distributions, do not add `D` again.
$$CAGR = \left(\frac{V_{end}}{V_{begin}}\right)^{1/n} - 1$$
where `n` is measured in years. The annualized geometric growth rate between two valuations with no intermediate cash flows.
Chain-links sub-period returns calculated between each external cash flow, removing the effect of cash flow timing. TWR measures the manager's investment skill independent of investor deposit/withdrawal decisions, and is the GIPS standard for manager performance.
$$1 + R_{TWR} = \prod_{i=1}^{n}(1 + R_i), \qquad R_i = \frac{V_{end,i}}{V_{begin,i} + CF_i} - 1$$
Exact TWR requires a portfolio valuation on every cash flow date.
When valuations on each cash flow date are unavailable, Modified Dietz approximates the period return by day-weighting each external cash flow within the period:
$$R_{MD} = \frac{V_{end} - V_{begin} - CF_{net}}{V_{begin} + \sum_i CF_i \times w_i}, \qquad w_i = \frac{CD - D_i}{CD}$$
where `CF_net` = sum of external cash flows, `CD` = calendar days in the period, and `D_i` = day of flow `i` (so `w_i` is the fraction of the period the flow was invested). It is a money-weighted approximation; chain-linking Modified Dietz sub-period returns approximates TWR. Accuracy degrades when flows are large relative to portfolio value or markets are volatile within the period — revalue on large-flow dates instead.
The internal rate of return that sets the NPV of all investor cash flows (contributions, withdrawals, and terminal value) to zero:
$$0 = \sum_{t=0}^{T} \frac{CF_t}{(1 + r)^t}$$
MWR reflects the actual investor experience because it is sensitive to the timing and magnitude of cash flows. Solved numerically (Newton-Raphson or bisection).
$$R_{annual} = (1 + R_{period})^{periods\_per\_year} - 1$$
For example, a 2% quarterly return annualizes to `(1.02)^4 - 1 = 8.24%`.
$$(1 + R_{total}) = \prod_{i=1}^{n}(1 + R_i)$$
The foundational identity behind TWR and CAGR.
**Given:** An investment of $10,000 grows to $16,105.10 over exactly 5 years with no intermediate cash flows.
**Calculate:** The compound annual growth rate (CAGR).
**Solution:**
CAGR = (V_end / V_begin)^(1/n) - 1 CAGR = (16,105.10 / 10,000)^(1/5) - 1 CAGR = (1.610510)^(0.2) - 1 CAGR = 1.10 - 1 CAGR = 0.10 = 10%
The investment grew at a compound annual rate of **10%** per year.
Verification: `$10,000 * (1.10)^5 = $10,000 * 1.61051 = $16,105.10`
**Given:** A fund has the following history:
**Calculate:** Both TWR and MWR, and explain the divergence.
**Solution:**
**Time-Weighted Return (TWR):**
Sub-period 1 return: R_1 = (120,000 - 100,000) / 100,000 = +20%
Sub-period 2 return: R_2 = (198,000 - 220,000) / 220,000 = -10%
TWR (cumulative) = (1 + 0.20) * (1 + (-0.10)) - 1
= 1.20 * 0.90 - 1
= 1.08 - 1
= +8.0%
TWR (annualized) = (1.08)^(1/2) - 1 = 3.92%**Money-Weighted Return (MWR / IRR):** Cash flows from the investor's perspective:
Solve: `-100,000 + (-100,000)/(1+r) + 198,000/(1+r)^2 = 0`
This is quadratic in `x = 1/(1+r)`; the positive root gives r = -0.66815% (verifiable with the bundled script or any IRR solver).
NPV check at r = -0.0066815:
-100,000 + (-100,000)/0.9933185 + 198,000/0.9933185^2 = -100,000 - 100,672.65 + 200,672.65 = 0.00 (exact)
The MWR is approximately **-0.67% annualized**.
**Interpretation:** The TWR of +3.92% annualized reflects the manager's skill: the fund gained 20% then lost 10%, netting
A collection of Claude Code skill plugins for financial services. 91 skills across 7 domain plugins teach Claude investment management, regulatory compliance, advisory workflows, trading operations, and more — so it can assist with finance questions, build
Design, build, and optimize dashboards for RIA practice management with AUM tracking, revenue analytics, and KPI frameworks. Use…
Design and implement end-to-end client onboarding workflows from prospect intake through funded account, covering KYC…
Design, generate, and deliver client performance reports across all channels, covering quarterly reports, tax reporting, portal…
Prepare advisors for client review meetings by assembling context packages, performance summaries, drift analysis, talking…
Design and optimize CRM systems and client lifecycle workflows for advisory firms, covering segmentation, household management,…
Build and manage advisory fee billing operations from fee schedule design through calculation, collection, revenue recognition,…
Complete, populate and fill out 3-statement financial model templates (Income Statement, Balance Sheet, Cash Flow Statement) .…
Complete, populate and fill out 3-statement financial model templates (Income Statement, Balance Sheet, Cash Flow Statement) .…