Nestly icon

AI Future Copilot

DashboardStudioLabLibraryBlogAboutGet Started
Engine · Technical overview

Nestly Horizon

The projection and calculator engine behind Nestly. One computation, one result, shared by the web app, the mobile app and every Read & Try scenario.


Overview

Nestly Horizon is the single computation pipeline behind every number in Nestly. It runs each sub-engine in dependency order, stores one fully resolved result, and every screen reads from that result instead of calculating on its own.

The calculation code is pure TypeScript with no platform dependencies and lives in one shared package that both the web app and the mobile app consume. That is what keeps web and mobile on identical results for the same inputs.

How a run works

A change to any input starts a run in three phases. The first is synchronous, so the plan responds instantly. The slower, probabilistic work is debounced and runs asynchronously, then the result is recomputed with it.

Input change
   |
   v
Phase 1 (instant)      projection, tax, Social Security, RMDs,
                       withdrawals, insights, Nestly Score, flight path
   |
   v
Phase 2 (async)        Monte Carlo + sustainable-income optimizer
   |
   v
Phase 3 (instant)      recompute scenario data with the Monte Carlo income
   |
   v
HorizonResult          one result, read by Dashboard, Studio, Results,
                       Goal Solver and the AI planner

Phase 1, deterministic. Year-by-year projection of balances across account types, with tax, Social Security, required minimum distributions, and withdrawal strategy applied. Pure functions, no network.

Phase 2, probabilistic. A Monte Carlo simulation and an income optimizer run on Nestly's calculation service. The default is 10,000 simulated paths, and the service accepts from 100 to 200,000.

Phase 3, reconcile. The scenario is recomputed with the Monte Carlo-backed income so the figures you see are consistent across screens.

What the engine models

Accounts and contributions. Traditional, Roth, taxable and HSA balances, employer contributions, and IRS contribution limits including catch-up amounts.

Taxes. Federal and state income tax, filing status, and Medicare IRMAA surcharges.

Social Security. Claiming-age effects, spouse benefits and survivor interactions.

Required minimum distributions. RMD schedules and strategies, including qualified charitable distributions.

Withdrawals. Tax-aware, proportional and bucket ordering, fixed-rate rules, and dynamic guardrails.

Other income and costs. Pensions, rental and planned income, healthcare, housing, debt, insurance, windfalls and life events such as downsizing.

Longevity and inflation. Life-expectancy horizon and inflation applied across the whole projection.

Monte Carlo and sustainable income

Goal, not a fixed percentage. Finds the highest after-tax monthly spending that still meets your success-rate target and ending-balance guardrail.

Found by simulation. The value comes from repeated Monte Carlo runs, not a rule like "4% of the portfolio".

Real market history. Returns are sampled from historical annual returns for stocks, 10-year Treasury bonds and cash, not an assumed bell curve.

Your mix. The stock, bond and cash mix is derived from your expected return, or the allocation you set.

Reproducible. A fixed random seed is the default, so the same inputs give the same simulation.

Spending adjusts each year. Portfolio withdrawals fall when Social Security, a pension or rental income starts, and rise when costs or taxes need more support.

One result, cached by input

Keyed by your inputs. Each result is tied to a stable hash of your plan inputs plus the run settings.

Reused across screens. If nothing changed, Nestly reuses the result as you move between screens. A changed input triggers a fresh run.

No duplicate work. Two screens asking for the same run share one request.

No stale answers. A response that no longer matches your current inputs is discarded.

Refreshed only when needed. Results last for the session and refresh only on an input change or an engine or assumptions update, never just because time passed.

How we check the math

Tests we run. As of October 2026: more than 2,700 automated tests on the shared calculation code used by web and mobile, including 47 web-and-mobile consistency tests, plus 248 tests on the Monte Carlo service.

Golden snapshots. A fixed set of reference scenarios has recorded expected outputs. Any intentional calculation change must regenerate them with a documented reason.

Same numbers on every device. We test that the web and mobile apps show the same numbers for the same plan, so what you see does not change depending on where you open it.

Independent audit bundle. A verification bundle can be given to external models and reviewers who recompute the expected values without trusting our outputs.

Versioned assumptions. Results carry an engine version and an assumptions version. Where an official figure for the current year is not yet published, the engine uses a clearly marked estimate and is updated when the figure is confirmed.

How AI is used

We built the model first. Nestly Horizon calculates the numbers, and the results it computes are what we feed to AI. AI works from that output. It does not do the math.

Turning your words into a plan. You can describe your finances or a goal in plain language. AI converts that into structured plan inputs and fills in only what your description supports.

Ranking actions. The engine generates candidate actions and works out their impact. AI ranks and refines them into a suggested order.

Describing results. AI writes plain-language summaries, such as plan descriptions and the one-sentence explanation of a path. Whether a path is worth it stays a fixed rule, not an AI judgment.

Building stress tests and score ideas. AI turns a concern such as "what if the market falls early?" into a structured stress-test scenario, and proposes Nestly Score scenarios. Score changes are recalculated by the app, not taken from the AI.

Guardrails. AI returns strict structured output that is validated. If it fails or times out, Nestly falls back to the engine's own wording.

In our articles. AI helps format and proofread articles and create article images. The Nestly Editorial Team produces the articles.

Limits

Horizon projects the plan you describe. Its output depends on your inputs and on assumptions about returns, inflation, taxes and longevity, and a Monte Carlo success rate is a probability, not a guarantee. Tax law and benefit rules change, and the engine models them as of its current assumptions version.


Important note. Nestly content and calculators are educational and planning-oriented. Projections are estimates based on the assumptions you provide and are not individualized investment, tax, legal, or financial advice.

Open Nestly LabHow the What-If engine works