Welcome to the new site. Problems, use store.hemrock.com

Using the fund economics engine in your product

The math behind the Fund Economics Tool on the web is shipped as @tdavidson/fund-economics-tool on Githubg and NPM. How to install it, what it exposes, how to script your own scenarios.

The fund-economics math powering the hosted Fund Economics Tool is published as a separate npm package @tdavidson/fund-economics-tool and also available on Github. The Hemrock site uses the same engine, and now you can use it in your own projects. Download it from Github and run it from your local browser, build your own UI on top of the engine, build it into your own forecasting and fund operations tools.

A single fund management company can use it free of charge. Service providers (fund administrators, outsourced CFOs, consultants), SaaS or white-label distribution, and use across multiple unrelated management companies require a commercial license. See the package's LICENSE or email hello@hemrock.com.

Install

npm install @tdavidson/fund-economics-tool  

The package is Node-safe and tree-shakeable. Three subpaths:

  • @tdavidson/fund-economics-tool, the core engine. computeFund, DEFAULT_INPUTS, scenario helpers, types.
  • @tdavidson/fund-economics-tool/ui, optional React components used by the hosted tool: tables, charts, input controls. You don't need this to use the engine.
  • @tdavidson/fund-economics-tool/mc, Monte Carlo simulation. Lazy-load it; it pulls in seeded RNG and lognormal sampling.

Compute a single fund

import {  
  computeFund,  
  DEFAULT_INPUTS,  
} from '@tdavidson/fund-economics-tool';

const result = computeFund(DEFAULT_INPUTS);

console.log(result.metrics.totalNetMoic);    // → 3.43 (default fund)  
console.log(result.metrics.lpNetMoic);       // → 2.95  
console.log(result.lp.distributions);        // → 72.3M  
console.log(result.gp.carriedInterestEarned); // → 11.3M  

result has per-side breakdowns (result.lp, result.gp) plus a total and headline metrics. Every dollar value is in fund currency at fund scale (you set currency and scale separately for display only, the engine works in raw numbers).

Apply scenario overrides

import {  
  applyScenario,  
  computeFund,  
  DEFAULT_INPUTS,  
} from '@tdavidson/fund-economics-tool';

const conservative = applyScenario(DEFAULT_INPUTS, {  
  // Override the large tier, same shape as the named-cases UI.  
  largeTierMultiple: 16,  
  largeTierShare: 0.06,  
});

const result = computeFund(conservative);  

applyScenario is the same helper the hosted Scenarios tab uses for its three named-case columns. You hand it a partial scenario; it returns a fresh FundInputs with the overrides applied (writeoffs auto-plug to 100%).

For more elaborate scenarios, e.g. shifting fees, fund size, recycling, just construct the FundInputs directly and call computeFund. There's no scenario DSL beyond what applyScenario covers; for everything else, mutate the inputs.

Run a Monte Carlo

import { DEFAULT_INPUTS } from '@tdavidson/fund-economics-tool';  
import { runMonteCarlo } from '@tdavidson/fund-economics-tool/mc';

const mc = runMonteCarlo(DEFAULT_INPUTS, {  
  iterations: 10_000,  
  seed: 42,           // deterministic; omit for random  
});

console.log(mc.metrics.lpNetMoic.mean);  
console.log(mc.metrics.lpNetMoic.percentiles.p5);  
console.log(mc.metrics.lpNetMoic.percentiles.p95);  
console.log(mc.lossOfCapitalProbability);  // P(LP net MOIC < 1)  

The Monte Carlo draws per-investment outcomes from your tier distribution, then per-investment multiples from a lognormal centered on each tier's stated multiple. See scenarios and simulation for the math behind that.

Reading the inputs

DEFAULT_INPUTS is a complete fund. Mutate it; don't construct a FundInputs from scratch unless you need to. Useful fields to know about:

  • committedCapital, fund size in dollars.
  • gpCommitPct, GP commit as a fraction (0.02 = 2%).
  • gpCommitCountedTowardInvested, when true (US venture default), GP pays no fees on its own commit and LP shoulders the full fee.
  • mgmtFeePct, mgmtFeePeriodYears, mgmtFeeSchedule, fee structure. Schedule is optional and overrides the flat-rate path when set.
  • recycledCapitalPct, share of called capital that gets recycled.
  • carryPct, carry rate. The waterfall is simple profit × carryPct, no preferred return, no GP catchup.
  • entryStages, array of investment stages. Each has its own allocation, reserves, check size, # of investments, and follow-on definitions.
  • returnTiers, power-law return tiers. Each tier has name, share, multiple, holdYears.
  • tierFractional, when false, investment counts floor to integers and called capital back-solves. Default is false (integer mode), which matches how the hosted tool ships.
  • tierInputMode, "% of capital" or "# of companies". Independent of the entry-stages table's input mode.
  • solveCalledFromDeployment, internal flag the hosted shell sets based on the input mode + integer toggle. The package handles it for you when you call computeFund from DEFAULT_INPUTS; if you're constructing inputs by hand, leave it false unless you know you want the back-solve.

The full type lives in node_modules/@tdavidson/fund-economics-tool/dist/types.d.ts after install.

When to use the package directly

Some workflows where dropping into the package is cleaner than the hosted tool:

  • Programmatic batch runs. Iterate fund sizes, fee structures, or check-size ranges in a Node script and write CSVs. Not what the hosted tool is for.
  • Embedding in a larger product. Build your own UI on top of the engine. The /ui subpath gives you the existing components, but they're not required, the engine is pure data in / data out.
  • CI sanity checks. Lock fund-economics outputs into a test suite so a refactor of your code doesn't accidentally shift fund metrics. The engine is deterministic given inputs.
  • AI-driven generation. Feed the prompts and skill files from /docs/ai into Claude or ChatGPT, generate FundInputs objects, and run them through computeFund. Same primer the MCP server uses.

Versioning

The package is on semver. Major versions ship with a migration note in the package CHANGELOG. The hosted tool stays on the latest version; if you depend on the package, upgrade at your own pace.

Where to read the math

docs/formula-map.md in the npm package walks every per-side calculation: how called capital splits, how fees compound onto LP, how recycling re-enters the deployment plan, how the waterfall computes carry. Read that file before changing engine behavior; the per-side invariants are easy to break.

The hosted tool's docs describe what the tool does (UX, sharing, collaboration). The package's formula-map.md describes what the math does.

License at a glance

Source-available, not open source. Free for a single fund management company applying it to its own funds, SPVs, and team. Commercial license required if any of the following apply:

  • You are a fund administrator, outsourced CFO, accountant, or consultant using the package across multiple clients.
  • You embed the package in a SaaS, white-label, or commercial product offered to multiple Fund Entities.
  • You operate the package on behalf of multiple unrelated management companies.

Source code, modifications, and CHANGELOG live publicly on GitHub. Distribution and resale require a commercial license. Email hello@hemrock.com for commercial licensing.