← All projects
Case study · Fintech · Decision tool · Live demo
Scenova

A cash-flow decision lab for a company that is profitable on paper and running out of cash.

A 12-person agency made +€38k profit in six months while its bank balance fell €71k. Scenova forecasts 13 weeks of cash from invoices, bills and payroll, ties every number to its source, and lets a finance lead test decisions (hiring, a late client, a sales dip) before making them. It also measures how wrong its own forecast tends to be.
RoleSolo: product, financial model, engineering
Timeline2026
TypeInteractive demo on sample data, open source
StackReact, TypeScript, Vite, Vitest, Web Workers, SVG charts
web-weld-five-54.vercel.app/
Scenova landing page: profitable on paper, out of cash in week 9
13
weeks forecast, every line traced
128
treasury plans searched in under 100 ms
2,000
seeded Monte Carlo paths
16%
4-week error, against 35% naive

Overview.

Who it is for, what goes wrong today, what Scenova does.
The audience

Finance leads at small service companies

Companies that invoice clients, run payroll every month and depend on a few large clients who pay late. The demo company and all of its data are fictional.

The problem

Profit says fine, the bank says otherwise

A P&L can't answer the questions that matter: why is cash falling if we are profitable, can we hire two people next month, what if our largest client pays a month late, and which fix helps most?

The product

A forecast you can question

Every weekly number opens into the invoices and rules behind it. Decisions become scenarios on the same engine, an optimizer prices the cheapest fix, and a backtest shows where the model is wrong.

Walkthrough.

The same path as the 2-minute tour inside the demo: from the cash problem to where the model can be wrong.
01 · Overview

Why a profitable company is running out of cash

The demo company, Atlas & Pine Studio, is a fictional 12-person agency. It made +€38k profit in six months while its bank balance fell €71k. The overview shows both numbers side by side, the bridge between them, and the week where cash breaks.

web-weld-five-54.vercel.app/app
Scenova overview with the cash alert and profit-to-cash bridge
The cash alert, four key numbers, the 13-week chart and the profit-to-cash bridge
  • 1
    Profit is not cashReceivables grew by €46k, and VAT and tax, loan repayments and equipment never appear in operating profit. The bridge shows each one.
  • 2
    The week that breaksCash drops to €14,412 in week 9, €5,588 under the €20,000 minimum the finance lead has set.
  • 3
    Every number labelledValues are marked known, assumed or needs review, and two imported items are flagged for a check before anyone relies on them.
02 · Forecast

Click the week that breaks and see the invoices behind it

The forecast runs week by week: opening balance plus cash in minus cash out. Clicking week 9 opens every line that moves money that week, with its date, rule and source.

web-weld-five-54.vercel.app/app/forecast
13-week cash forecast with weekly flows
Closing balance and weekly flows, with the 13-week table below
web-weld-five-54.vercel.app/app
Week 9 drill-down with each payment and its source
Week 9: €84,200 out, €0 in, and where each line comes from
  • 1
    Traceable linesPayroll €56,000, year-end bonuses €21,000 and software licences €7,200, each tied to a payroll rule or a bill id.
  • 2
    Client habits, measuredA client payment lands on its due date plus that client's measured average delay. Helix Retail pays 34 days late on average.
  • 3
    The next receiptThe drawer also says when the next large payment arrives, so the gap has an end date.
03 · Scenarios

Decisions become scenarios on the same engine

Late payments, a hiring plan, a sales downturn and a recovery plan run through the same forecast. A custom scenario has its own sliders. The comparison shows the lowest balance, the first week below the minimum and the change against the base case.

web-weld-five-54.vercel.app/app/scenarios
Scenario comparison chart and table
Five scenarios on one chart, compared week by week
  • 1
    Late clientIf Helix Retail pays 30 days later than usual, the low point falls to −€15,388.
  • 2
    Hiring planTwo hires from 16 November take the low point to −€408. The recovery plan never breaches.
  • 3
    One change at a timeEach change in a scenario is measured on its own, so the finance lead sees which one moves the result.
04 · Optimizer

An optimizer that prices the fix

Seven treasury moves are available, such as early-payment discounts for clients, moving a vendor invoice, an overdraft and a tax deferral. Every combination runs through the forecast, and the best plans are stress-tested against uncertain payment dates.

web-weld-five-54.vercel.app/app/fix
Cash fix optimizer with the cheapest and the robust plan
128 plans searched in 76 ms in a background thread
  • 1
    CheapestOne move, a one-month tax deferral, costs €38 and keeps cash above the minimum, but 14% of simulated paths still breach.
  • 2
    RobustAdding a vendor move costs €188 and cuts the share of breaching paths to 7%. The page shows the trade instead of hiding it.
  • 3
    Who must agreeEach move is tagged with who has to say yes (a client, a vendor or the tax office) and can be applied as a scenario.
05 · Risk

2,000 possible futures instead of one

Payment delays and monthly sales are uncertain, so the risk page simulates 2,000 paths with delays drawn from each client's own history. The result is a share of model runs, and the page says so.

web-weld-five-54.vercel.app/app/risk
Monte Carlo risk simulation with percentile bands
Median, P25–P75 and P10–P90 bands around the deterministic forecast
  • 1
    Base case44% of paths fall below €20,000 at least once. In a bad case (P10) the low point is €7,835.
  • 2
    Editable assumptionsDelay uncertainty and sales volatility are sliders, with the formula written under each one.
  • 3
    ReproducibleRuns are seeded, so the same seed gives the same result, and they run in a Web Worker so the page never freezes.
06 · Accuracy

A forecast that reports its own error

A forecast is only useful if it beats something simple. Scenova replays 17 past weeks using only what was known on each date, then compares its receipts forecast with what actually arrived and with a naive baseline.

web-weld-five-54.vercel.app/app/accuracy
Forecast accuracy backtest against a naive baseline
Engine against the naive 4-week average, by horizon
  • 1
    Better than naiveFour-week receipts error is 16% for the engine and 35% for the average of the last four weeks.
  • 2
    Known biasThe engine is about 10% too optimistic: Helix Retail pays later every month, and averages lag a trend.
  • 3
    Said on the pageThe weakness is written next to the result, not left for the user to discover.
07 · Ask Scenova

An assistant that proposes inputs and never invents a number

Ask “what if I hire a developer at €3,000 a month and our biggest client pays a month late?” and Scenova turns the question into assumptions, marks where each one came from, and waits for confirmation before the engine runs.

web-weld-five-54.vercel.app/app
Ask Scenova turning a question into labelled assumptions
Assumptions marked from question, from data or default, with Confirm and Cancel
  • 1
    Origins shownThe salary comes from the question, the 1.30 employer cost and the late payer from the data, and the start date is a default to check.
  • 2
    Nothing runs on its ownThe engine only runs after the user confirms, and the answer explains the result with its sources.
  • 3
    Ready for an LLMThe parser is rule-based today. Its output has the shape an LLM with function calling returns, so it can be swapped in later.
13-week cash forecast
Scenario comparison
Treasury optimizer
Monte Carlo risk
Backtest against a baseline
Data-quality checks
Guided 2-minute tour
Model & limits page

How the numbers are made.

One engine, five steps, and nothing the user can't trace.
1 · ImportBank balance, open invoices, bills and payroll rules, with data checks that flag what needs review.
2 · ForecastClosing = opening + cash in − cash out, week by week for 13 weeks.
3 · DecideScenarios and the optimizer change inputs, never the engine.
4 · StressMonte Carlo on payment delays and sales, seeded and reproducible.
5 · ExplainEvery result links back to the invoice, bill, rule or assumption behind it.
A new hire costs salary × 1.30 for employer charges, with the first month prorated. A client payment lands on its due date plus that client's measured average delay, adjusted by the scenario.

Architecture.

A browser-only app: a pure calculation engine, workers for the heavy work, and pages that only display.
Interface
React 18 and TypeScriptVite · React Router · 9 pages: overview, forecast, scenarios, optimizer, risk, data, accuracy, model, case study
Hand-built SVG chartsNo chart library · forecast, scenario, percentile-band and backtest charts
Ask ScenovaQuestion → assumptions → confirmation → engine → explanation with sources
→
Engine
Pure TypeScriptForecast, scenarios, drivers, optimizer, Monte Carlo and backtest · no UI code, no I/O
Web WorkersMonte Carlo and the optimizer run off the main thread · stale results ignored
Vitest19 tests, including one that checks all 128 optimizer plans
→
Data
Demo companyAtlas & Pine Studio · invoices, bills, payroll rules and a bank balance
Seeded payment historySynthetic and reproducible, so every backtest and simulation can be checked
No backendNothing the user changes is saved · hosted as a static site on Vercel
About 4,600 lines of TypeScript. The code is public on GitHub.

Engineering deep dives.

Six decisions behind a forecast a finance lead can trust, each with what it cost.

1. Exhaustive search, not a solver

Problem
The finance lead needs the cheapest set of treasury moves that keeps cash above the minimum, and needs to see why it is the cheapest.
Approach
With seven moves there are only 128 plans, so every one runs through the full forecast. Costs come from the forecast's own discount, fee and interest lines. One unit test checks all 128 plans to prove the answer really is the cheapest.
Trade-off
Exhaustive search stops being practical somewhere past fifteen moves. At that point a solver would replace it.
Lives in: web/src/engine (optimizer)

2. From 270 µs to 21 µs per forecast

Problem
The optimizer and its stress tests run thousands of forecasts. The page has to answer while the user is still looking at it.
Approach
Date maths is memoised and each week is totalled in a single pass, which took one forecast from about 270 µs to 21 µs on a laptop. The full search with stress tests finishes in under 100 ms, off the main thread, and stale results are ignored.
Trade-off
Memoisation is extra state to keep correct, so the engine's tests cover the cached paths too.
Lives in: web/src/engine · Web Workers

3. Cheapest is not safest

Problem
The cheapest fix clears the minimum by only €3,912. One late payment and it fails.
Approach
The best plans are stress-tested with 300 simulated payment-date paths each. The page shows the cheapest plan (€38, 14% of paths still breach) next to the robust one (€188, 7%).
Trade-off
The robust plan costs €150 more. Scenova shows the trade and leaves the choice to the finance lead.
Lives in: optimizer + Monte Carlo

4. A backtest against a naive baseline

Problem
A forecast with no error measure is a guess with decimals.
Approach
Seventeen past weeks are replayed with no look-ahead and compared with the average of the last four weeks. The engine's 4-week receipts error is 16% against 35%. The first version, with one date per invoice, lost to the naive baseline; a spread of dates won.
Trade-off
The forecast still uses one date per invoice so each line stays traceable, while the backtest uses the spread. The two are not aligned yet.
Lives in: web/src/engine (backtest)

5. An assistant that never produces a number

Problem
In finance, an AI that invents a figure is worse than no AI at all.
Approach
A question becomes assumptions, each marked as coming from the question, the data or a default. A missing salary is asked for, not guessed. Nothing runs until the user confirms, the engine computes, and the assistant only explains.
Trade-off
A rule-based parser understands fewer phrasings than an LLM. Its output format is what function calling returns, so Gemini could replace it without changing the flow.
Lives in: web/src/assistant

6. Honest about uncertainty

Problem
Monte Carlo percentages look like promises, and every model is wrong somewhere.
Approach
Runs are seeded and labelled as a share of model runs, not a real-world probability. A Model & limits page lists every formula and the known weaknesses: clients are simulated independently, future sales are a flat rate, and credit lines and VAT on new invoices are not modelled.
Trade-off
The numbers look less impressive. They are also the ones a finance lead can defend.
Lives in: Model & limits page