Unit Economics & Business Math
The arithmetic that quietly decides whether a business lives or dies: margin, contribution, break-even. The numbers most owners never actually run.
1 pieceThe Universal Margin
This paper describes a financial calculation engine built from the realisation that the math of profitability is identical for every type of business. A seven-stage deterministic pipeline resolves tax, computes order-weighted margins, applies a cash-flow-correct refund model with per-product recoverability, and derives break-even boundaries; the same 335 lines of code for e-commerce, services, subscriptions, and lead generation. A vocabulary layer swaps the terminology without touching the math. Products, campaigns, and organic traffic sources collapse into a unified entity abstraction with per-channel elasticity physics. A goal solver reverse-engineers the exact adjustment to every available lever (pricing, costs, budget, conversion) needed to hit a profit target, ranked by effort score. A constitutional test suite runs 10,000 randomised scenarios per invariant, cross-references a Python oracle, and enforces named axioms: Conservation of Mass proves refund handling is correct; Service Identity proves the engine is truly universal. 117,893 lines of TypeScript. Nine revenue channels. Four business models. One engine. This paper reports on the architecture, the six failed versions that preceded it, and the discovery that started as a spreadsheet at an agency where nobody not the strategists, not the clients, not (in one case) the client's accountant could answer the most basic question in business: how much money do you actually make per sale?