Time Value Of Money logo

Time Value Of Money

Community
JoelLewis
time-value-of-money

Calculate present value, future value, NPV, IRR for projects and loans, loan payments, and amortization schedules across all compounding conventions. Use when the user asks about discounting cash flows, valuing an annuity or perpetuity, comparing investments with different timing, building a mortgage amortization table, evaluating whether a project is worth pursuing, or solving for the rate that equates cash flows (project IRR, loan IRR, yield on an investment). Also trigger when users mention 'what is it worth today', 'how much will I have in 20 years', 'monthly payment on a loan', 'discount rate', 'Gordon growth model', 'effective annual rate', 'continuous compounding', or ask how to compare a lump sum versus a stream of payments. For portfolio money-weighted return (dollar-weighted IRR on an investor's contributions and withdrawals), use return-calculations instead.

Overview

PublisherJoelLewis
Repositoryfinance_skills
Skill nametime-value-of-money
Stars
217
Forks
37
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by JoelLewis on GitHub. Read the source before you install it.

Installation

Install the Time Value Of Money AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/JoelLewis/finance_skills/tree/main/plugins/core/skills/time-value-of-money
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/JoelLewis/finance_skills.git /tmp/finance_skills
mkdir -p .claude/skills
cp -r /tmp/finance_skills/plugins/core/skills/time-value-of-money .claude/skills/time-value-of-money
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Time Value Of Money in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Time Value Of Money on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Time Value Of Money is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Time Value of Money

Core Concepts

Future Value (FV)

The value of a present sum after earning interest for n periods at rate r per period.

$$FV = PV \times (1 + r)^n$$

Future value grows exponentially with time, which is the mathematical basis of compound interest.

Present Value (PV)

The current worth of a future sum, discounted back at rate r for n periods. This is the inverse of future value.

$$PV = \frac{FV}{(1 + r)^n}$$

Present value is the cornerstone of all valuation: a dollar today is worth more than a dollar tomorrow because of the opportunity cost of capital.

Compounding Conventions

Interest can compound at different frequencies. The nominal annual rate r_nom compounded m times per year produces different effective yields.

Discrete compounding (m times per year):

$$FV = PV \times \left(1 + \frac{r_{nom}}{m}\right)^{m \times t}$$

Continuous compounding:

$$FV = PV \times e^{r \times t}$$

Effective Annual Rate (EAR):

$$EAR = \left(1 + \frac{r_{nom}}{m}\right)^m - 1$$

For continuous compounding: EAR = e^(r_nom) - 1

Common frequencies:

Frequencym
Annual1
Semi-annual2
Quarterly4
Monthly12
Daily365
Continuousinfinity

Ordinary Annuity

A series of equal payments made at the end of each period for n periods.

Present Value:

$$PV = PMT \times \frac{1 - (1 + r)^{-n}}{r}$$

Future Value:

$$FV = PMT \times \frac{(1 + r)^n - 1}{r}$$

Annuity Due

A series of equal payments made at the beginning of each period. Each cash flow is one period closer than in an ordinary annuity, so values are scaled by (1 + r).

Present Value:

$$PV = PMT \times \frac{1 - (1 + r)^{-n}}{r} \times (1 + r)$$

Future Value:

$$FV = PMT \times \frac{(1 + r)^n - 1}{r} \times (1 + r)$$

Growing Annuity

A finite series of payments that grow at a constant rate g per period, where g != r.

Present Value:

$$PV = \frac{PMT}{r - g} \times \left[1 - \left(\frac{1 + g}{1 + r}\right)^n\right]$$

This is widely used in equity valuation (e.g., multi-stage dividend discount models) and salary/pension projections.

Perpetuity

An infinite stream of equal payments.

$$PV = \frac{PMT}{r}$$

Growing Perpetuity

An infinite stream of payments growing at constant rate g, where g < r for convergence.

$$PV = \frac{PMT}{r - g}$$

This is the Gordon Growth Model when applied to dividends.

Net Present Value (NPV)

The sum of all discounted cash flows, including the initial investment. A positive NPV indicates value creation.

$$NPV = \sum_{t=0}^{T} \frac{CF_t}{(1 + r)^t}$$

Typically, CF_0 is a negative outflow (initial investment), and subsequent CF_t are inflows.

Internal Rate of Return (IRR)

The discount rate r that makes the NPV of all cash flows exactly zero.

$$0 = \sum_{t=0}^{T} \frac{CF_t}{(1 + r)^t}$$

IRR is solved numerically (Newton-Raphson or bisection) since there is no closed-form solution for general cash flow streams. For conventional cash flows (one sign change), a unique IRR exists.

Amortization

Each payment on an amortizing loan is split into an interest component and a principal component:

  • Interest portion: Interest_t = Balance_{t-1} * r
  • Principal portion: Principal_t = PMT - Interest_t
  • Remaining balance: Balance_t = Balance_{t-1} - Principal_t

Over time, the interest portion decreases and the principal portion increases.

Key Formulas

FormulaExpressionUse Case
Future ValueFV = PV * (1 + r)^nCompound a lump sum forward
Present ValuePV = FV / (1 + r)^nDiscount a future lump sum
EAR(1 + r_nom/m)^m - 1Compare rates across compounding frequencies
Continuous FVFV = PV * e^(r*t)Continuous compounding
Ordinary Annuity PVPMT * [1 - (1+r)^(-n)] / rLoan payments, lease valuation
Annuity Due PVPMT * [1 - (1+r)^(-n)] / r * (1+r)Rent, insurance (paid in advance)
Growing Annuity PVPMT/(r-g) * [1 - ((1+g)/(1+r))^n]Salary streams, growing dividends
Perpetuity PVPMT / rPreferred stock, consol bonds
Growing Perpetuity PVPMT / (r - g)Gordon Growth Model
NPVsum(CF_t / (1+r)^t)Project/investment evaluation
IRRsolve: sum(CF_t / (1+r)^t) = 0Return metric for uneven cash flows

Worked Examples

Example 1: Monthly Mortgage Payment

Given: A $300,000 mortgage at a 6.5% annual interest rate, fixed for 30 years, with monthly payments (ordinary annuity).

Calculate: The monthly payment amount.

Solution:

First, convert the annual rate to a monthly rate and years to months:

r_monthly = 0.065 / 12 = 0.00541667
n = 30 * 12 = 360 months

Using the ordinary annuity present value formula, solve for PMT:

PV = PMT * [1 - (1 + r)^(-n)] / r

300,000 = PMT * [1 - (1.00541667)^(-360)] / 0.00541667

Compute the annuity factor:

(1.00541667)^360 = 6.99179
(1.00541667)^(-360) = 0.143010
1 - 0.143010 = 0.856990
0.856990 / 0.00541667 = 158.2108

Solve for PMT:

PMT = 300,000 / 158.2108 = $1,896.20

The monthly mortgage payment is $1,896.20.

Over 30 years, total payments = 360 * $1,896.20 = $682,632, meaning total interest paid is $682,632 - $300,000 = $382,632.

Example 2: NPV of a Project with Uneven Cash Flows

Given: A project requires an initial investment of $50,000 and produces the following cash flows:

  • Year 1: $12,000
  • Year 2: $15,000
  • Year 3: $18,000
  • Year 4: $22,000
  • Year 5: $25,000

The required rate of return (discount rate) is 10%.

Calculate: The NPV and whether the project should be accepted.

Solution:

Discount each cash flow to present value:

PV(CF_0) = -50,000 / (1.10)^0 = -50,000.00
PV(CF_1) =  12,000 / (1.10)^1 =  10,909.09
PV(CF_2) =  15,000 / (1.10)^2 =  12,396.69
PV(CF_3) =  18,000 / (1.10)^3 =  13,523.67
PV(CF_4) =  22,000 / (1.10)^4 =  15,026.30
PV(CF_5) =  25,000 / (1.10)^5 =  15,523.03

Sum all present values:

NPV = -50,000.00 + 10,909.09 + 12,396.69 + 13,523.67 + 15,026.30 + 15,523.03
NPV = +$17,378.78

Since NPV is positive ($17,378.78), the project creates value and should be accepted. It earns more than the 10% required rate of return.

To find the IRR, we would solve for the rate where NPV = 0. Numerically, the IRR for this cash flow stream is approximately 21.2% (21.18%), well above the 10% hurdle rate.

Common Pitfalls

  • Mismatching rate and period frequency: if payments are monthly, the discount rate must be a monthly rate. Divide the annual nominal rate by 12, do not take the 12th root of (1 + annual rate) unless converting from EAR.
  • Forgetting the sign convention for cash flows in IRR: outflows (investments) must be negative and inflows (returns) positive, or vice versa, but the convention must be consistent. Incorrect signs produce meaningless IRR results.
  • Confusing nominal vs effective rates: a 12% nominal rate compounded monthly produces an EAR of 12.68%, not 12%. Always clarify the compounding basis.
  • Off-by-one errors in annuity due vs ordinary annuity: an annuity due shifts all payments one period earlier. Forgetting the (1 + r) adjustment factor will undervalue annuity-due streams.
  • Multiple IRR solutions with non-conventional cash flows: when cash flows change sign more than once (e.g., initial outflow, inflows, then a large terminal outflow), Descartes' rule allows up to as many positive real IRR solutions as there are sign changes. In such cases, use NPV profiling or the Modified IRR (MIRR) instead.

Running the Script

scripts/time_value_of_money.py implements every formula above as static methods on a TimeValueOfMoney class (present_value, future_value, npv, irr, annuity_pv, annuity_fv, growing_annuity_pv, perpetuity_pv, fisher_rate, continuous_compounding) plus an AmortizationSchedule class.

  • Run: uv run scripts/time_value_of_money.py (PEP 723 inline metadata; stdlib-only, no third-party dependencies), or simply python3 scripts/time_value_of_money.py.
  • Bare invocation (or --verify) prints a demo of all methods and asserts the worked-example values above (Example 1 mortgage payment = $1,896.20; Example 2 NPV = $17,378.78 and IRR = 21.18%), exiting nonzero on any mismatch.
  • --help lists the available methods and import usage.
  • For programmatic use, import rather than run: from time_value_of_money import TimeValueOfMoney, AmortizationSchedule, then call e.g. TimeValueOfMoney.npv(...).

Cross-References

  • return-calculations (core plugin): CAGR is a special case of compound growth; portfolio MWR uses the same NPV=0 framework and lives there
  • statistics-fundamentals (core plugin): Discount rate estimation often relies on regression (CAPM beta) and distributional assumptions

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Time Value Of Money AI skill do?

Calculate present value, future value, NPV, IRR for projects and loans, loan payments, and amortization schedules across all compounding conventions. Use when the user asks about discounting cash flows, valuing an annuity or perpetuity, comparing investments with different timing, building a mortgage amortization table, evaluating whether a project is worth pursuing, or solving for the rate that equates cash flows (project IRR, loan IRR, yield on an investment). Also trigger when users mention 'what is it worth today', 'how much will I have in 20 years', 'monthly payment on a loan', 'discou...

Why use Time Value Of Money on TypingMind?

Because you install it once and use it with any model. Time Value Of Money is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Time Value Of Money in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/JoelLewis/finance_skills/tree/main/plugins/core/skills/time-value-of-money. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Time Value Of Money?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Time Value Of Money?

As many as you like. As long as a model supports skills, you can use Time Value Of Money with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Time Value Of Money AI skill free?

Yes. It is published on GitHub by JoelLewis under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇