Avinash RayuduEmail me

Case study, synthetic brands

A BFCM cash copilot that explains its own misses

forecast-health-monitor

A 13-week cash forecast for an online brand going into Black Friday and Cyber Monday. It splits each miss into its drivers, then turns the explanation into dated actions: a credit draw with its repay date, which bills to pay early, and what to do with cash after the trough.

The problem

Fernwood Goods is a synthetic brand with a corrected $8.4M plan P&L; nine more synthetic brands make up the portfolio.

A forecast that misses is normal. What an operator needs on Monday is why it missed and what to do about it. A payout shortfall can be a refund spike on one SKU, a held payout that comes back next week, or a retailer paying late, and each calls for a different action.

The approach

  • A driver-based forecast: Shopify sales and refunds by SKU, fees, chargebacks, payout timing, Amazon settlements, wholesale terms by retailer, ad spend by platform, and bills with terms and dates.
  • Variance split by swapping one driver at a time from forecast to actual, so the pieces add up to the line exactly.
  • A finding has to beat both the driver's own normal noise (z = 3) and the brand's materiality.
  • Rules then reforecast, size the credit draw with a cushion, pick bill timing under vendor rules, and compare paying down the line against sweeping to savings.

The Monday brief, Nov 16

Example from my forecast-health-monitor project. Synthetic brand, synthetic data.

Fernwood Goods, a synthetic brand: 13-week cash forecastClosing cash by week, in thousands of dollars: Oct 26 429, Nov 2 567, Nov 9 804, Nov 16 194, Nov 23 595, Nov 30 808, Dec 7 992, Dec 14 1105, Dec 21 1085, Dec 28 1164, Jan 4 968, Jan 11 1015, Jan 18 889. The cash buffer is 300. The low point is 194, in the week of Nov 16. Synthetic data.Week ofOct 26Nov 2Nov 9Nov 16Nov 23Nov 30Dec 7Dec 14Dec 21Dec 28Jan 4Jan 11Jan 18$0K$500K$1,000Kbuffer $300Klow point $194,498Closing cash, $K4295678041945958089921,1051,0851,1649681,015889
Fernwood Goods, a synthetic brand: 13-week cash forecastClosing cash by week, in thousands of dollars: Oct 26 429, Nov 2 567, Nov 9 804, Nov 16 194, Nov 23 595, Nov 30 808, Dec 7 992, Dec 14 1105, Dec 21 1085, Dec 28 1164, Jan 4 968, Jan 11 1015, Jan 18 889. The cash buffer is 300. The low point is 194, in the week of Nov 16. Synthetic data.$0K$500K$1,000Kbuffer $300Klow $194,498Oct 26Nov 16Dec 7Dec 28Jan 18
Fernwood Goods, week-0 forecast. The low point is $194,498 in the week of Nov 16, when a $520K inventory balance and $95K of freight land together.
The brief is written from actuals through Nov 15 and the reforecast that follows from them.
  • Refunds ran 1.7x forecast, and SKU FW-2201 is 99% of the excess. Carrying that rate two more weeks, and paying one bill early, moves the low point to $99,718.
  • Draw $225,000 on Monday and repay it the week of Nov 23. Interest is about $476.
  • Pay ShipNest 3PL's $69,211 invoice now to take the 2% discount: it saves $1,384 against at most about $430 of interest.
  • After the trough, pay down $183,313 of the credit line before sweeping to savings, worth about $15,435 a year more.

Two draws, two moments. Before any actuals, the week-0 forecast bottoms at $194,498, $105,502 under the buffer, so the smallest draw in $25,000 steps that holds it is $125,000; that is the figure the third project grades.

By Nov 16, refunds have pushed the reforecast low point to $99,718 and the draw adds a cushion for receipts not yet in, so the brief calls for $225,000. Open the full brief.

Forecast to actual, through Nov 15

Week-0 forecast, closing cash in the week of Nov 9$803,902Shopify payouts: refunds-$14,301Amazon settlements: volume-$1,445Payroll: unexplained-$161Bank fees and other: noise+$18Shopify payouts: chargebacks+$206Wholesale receipts: volume+$909Shopify payouts: volume+$6,517Actual closing cash$795,644
Each step swaps one driver from forecast to actual, so the steps add up to the $8,257 shortfall exactly. Refunds drive the miss: without them, cash would have come in about $6,000 ahead of the forecast.

When the forecast matters: tight credit

Always pay early$140,937Forecast-aware$67,629
With only $50K of credit headroom, always paying early pushed the worst unplanned dip under the buffer to $140,937. The forecast-aware policy held it at $67,629 by giving up $9,894 of discounts. The remaining dip is Fernwood's trough itself.

With normal credit every policy takes every early-pay discount, and they tie. That is the honest result: 2/10 net 30 is worth about 37% a year, so borrowing at 11% to take it always pays.

Results

Eight false alarms in 650 event-free brand-weeks is about 0.16 per brand per quarter.
Detection and diagnosis
Event setEventsFound (from the committed run)Right cause (from the committed run)Precision (from the committed run)False alarms (from the committed run)
Development, built against12121294%1
Holdout, written after the freeze88879%3
Noise only, 650 brand-weeks08

(from the committed run) copied from the committed run, as published in the project README.

8 false alarms in 650 event-free brand-weeks, about 1 in 80.

The holdout included two causes the development set never had, a Shopify fee change and an Amazon fee change. Both were found and named.

The workbook

Fernwood's forecast is also an Excel model with Inputs, Forecast, Calendar, Bills and a Check tab. Every line and week ties to the Python engine to the cent, the Check tab shows it, and changing an input moves the forecast.

Why the buffer is $300,000

It is a little under two weeks of Fernwood's average forecast outflows: $2.13M over 13 weeks, about $164K a week. The other nine brands get the same policy computed from their own ledgers, two weeks of outflow.

The detection bar (3 standard deviations), the materiality floor (the larger of $2,500 or 1.5% of weekly receipts) and the draw cushion (1.65 standard deviations, one-sided 95%) are explained in the repository README.

What changed after the holdout

The first holdout run is kept unchanged in the repository. It showed that draws had no cushion (two brands dipped under the buffer by up to $2,717), that the reforecast had no rule for fee changes, and that Amazon fee findings were worded as processing fees. I fixed all three, so the holdout is not a blind test of the fixed version.

Where this fits at Highbeam

My reading of Highbeam's public pages (Luma, Highbeam Intelligence, Building Luma) and the AI Implementation Associate posting. Not affiliated with Highbeam; no Highbeam data is used.
Where this fits at Highbeam
This workHighbeam or Luma workflow it showsThe role's work it rehearses
A driver-based 13-week forecast per brandLuma's baseline cash forecasting and its view of a brand's true cash positionForecast health monitoring
Miss attribution, detection and the Monday briefThe Alerts and reporting agent, which monitors key metrics and writes weekly reportsExplaining a messy cash situation clearly to a founder
Draw sizing with a cushion and a repay dateHighbeam's revolving line of creditCash management recommendations
Bill timing under vendor rules and discountsHighbeam Bill PayAP and bill pay setup
Paydown vs sweep after the troughThe Treasury agent, which maximizes yield and minimizes interestCash management recommendations
The Excel twin that ties to the codeExcel and Sheets modeling

Finance concepts

The forecast is on a cash basis: it turns the accrual plan P&L into the weeks money actually moves. Accounts receivable shows up as wholesale receipts by retailer and terms; accounts payable as bills with terms, due dates and early-pay discounts. The finance concepts behind these projects.

How I built this

I built this with Claude Code, Anthropic's coding agent. I chose the problem and set the rules the work had to follow: synthetic brands only, one engine for the forecast and the simulated actuals, hidden event labels the monitor never reads, freeze the detector before writing the holdout, and no number on this page that a committed run did not produce.

Claude Code wrote most of the code, tests and first drafts of the docs under that direction and ran the evals. I read the results, decided what to fix and what to leave visible, and ran reviews from an implementation team's point of view that drove the last rounds of changes. The commit history and the CHANGELOG in the repository show the order things happened in.

Limits

  • The simulated world and the forecast share one engine, so every miss has a driver that explains it. Real brands have causes outside any model.
  • I wrote both the events and the detector. The noise-only worlds are the least biased measure.
  • The monitor needs actuals at driver grain: refunds by SKU, settlement reserve lines, invoices by retailer.
  • The 11% credit line rate and 2.58% savings yield are illustrative.
  • Fernwood's levels come from its plan, not its onboarded ledger. The ledger runs at roughly 1.9 times the plan (an earlier note said 30%, which was wrong); the two were built separately and I did not force them to agree. Fernwood takes only its noise, payroll Fridays and card autopay date from the ledger. The other nine brands take their levels straight from their ledgers.

Back to all projects