Risk-of-Ruin Max Stake Calculator — Ceiling, Not Target
From a Stylised Trade to a Real Session
In the TMDA post we asked whether one repeated wager is profitable, sustainable, and survivable, and found the largest stake fraction whose probability of a 50% drawdown inside 2,300 bets stayed under 5%. Clean inputs, clean answer.
A real exchange session is not like that. There is no single win probability and no single price. What there is is a history: a spreadsheet of every bet, with its stake and the market's net result. This post turns the survivability question loose on such a history and asks: what is the most I can put at risk in one market without a realistic chance, over time, of halving the starting bank?
The Question TMDA Left Open
So the question becomes: given this history, and a bank I refuse to see halved more than one time in twenty, what is the maximum liability I should carry into any one market?
m / v, about 1.6% on this session).
The Model: Fixed-Stake Ruin
Treat the bank as a random walk with drift. Each market adds a result drawn from the same distribution: mean
m and variance v per unit of liability. Stake a fixed fraction s of the
starting bank in every market. The classical continuous-time result (Feller, Ross) gives the probability
that the walk ever falls by D before drifting away:
s_max = 2 · m · D / ( v · ln(1/r) )
| Symbol | Meaning | Value |
|---|---|---|
s_max |
Maximum liability per market, as a fraction of the starting bank. Held fixed for a session; recalculated at session end. | answer |
m |
Mean market result per unit of liability | history |
v |
Variance of those results | history |
D |
Drawdown that counts as ruin, from the starting balance | 50% |
r |
Accepted probability of ever hitting that drawdown | 5% → ln(1/r) = 2.9957 |
Two properties matter for what follows. First, s_max is linear in m and inversely
proportional to v: how you measure the mean and variance from history decides the number.
Second, if m ≤ 0 the ceiling is zero — no positive stake is safe without an edge, and the
formula says so bluntly.
Attribution: this expression is often called the “Mason Malmuth formula” in poker circles. That attribution has been publicly retracted by Malmuth himself. It is the standard gambler's-ruin result for Brownian motion with drift and has no single eponym; cite Feller (1971, Vol. 2, Ch. XIV) or Ross (1996). Chen & Ankenman (2006, Ch. 22) give the poker-facing derivation.
The Data: An Exchange Report
The input is the exchange's own market P&L report, one row per bet: Date, Market, Ref No, Selection,
Odds, Stake, Bet P&L, Market P&L, Net P&L. The file covers 2 March to 30 April
2026.
A market is one betting event; its liability is the sum of stakes placed into it, and its result is the net
P&L
the exchange reports for it after commission. The calculator keeps racing Win markets only — other market
types
are other strategies and are sized separately — and drops any market whose recorded liability cannot bound
its
loss.
| Quantity | Win markets only |
|---|---|
| Bets (rows) | 5,880 |
| Markets | 330 |
| Total liability | €15,824.53 |
| Total net P&L | €913.27 |
| Overall return on liability | 5.77% |
| Bets per market (mean) | 17.8 |
The result per market is expressed as return on liability: net P&L divided by liability. A
total loss is −1.00; scratching is 0.00; the best Win market in the period (€26 liability, €300.54
net) is +11.56. These ratios are the raw material for m and v.
Three Ways to Read the Same History
The formula wants a mean and a variance. There are at least three defensible ways to extract them from 330 market results, and they disagree by a factor of 3.3. Working through them is the point of the exercise.
Method 1 — Wins and Losses
The spreadsheet-trader's instinct: count profitable markets, compute a strike rate p, take the
average odds of the winning selections O, and treat every market as a coin that pays
O − 1 or loses 1.
m = p · (O − 1) + (1 − p) · (−1) = 0.3273 × 24.00 − 0.6727 = 7.182
v = p · (24 − m)² + (1 − p) · (−1 − m)² = 137.60
s_max = 2 × 7.182 × 0.50 / (137.60 × 2.9957) = 1.74% = €174.22
Read m = 7.182 again. It claims the average market returns seven times its liability. The
session's actual return was 5.77%. The method has silently assumed each win puts the whole liability on one
selection
at 25.0, when in fact the trader spreads eighteen bets across the field and a winning market returns about
2.6× liability, not 24×. Both m and v are inflated by orders of magnitude;
the
ratio happens to net out to a stake 2.5× too generous.
Method 2 — Profit and Loss (banded)
The spreadsheet approach: sort each market's return-on-liability into five bands, weight each band by how often it occurs and by its mean result. Sizes now survive, but each band is collapsed onto its mean.
−1 is a total
loss, the floor for anyone backing — you cannot lose more than you staked. 0 is a scratch:
liability committed, nothing won or lost. +1 is the point where a market returns more than the
liability that was risked in it. Those three points partition the number line into exactly five regions —
total loss, partial loss (reds), scratch, modest win (greens), and outsized win — which is also how a trader
describes a day. The regions do not overlap and, between them, cover every result a backer can record, so each
market lands in exactly one band and the probabilities must sum to 100% by construction. When the
checksum reads anything else, the bands are not what is wrong; the data is.
| Band | Meaning | Count | Probability | Mean result | Contribution to m |
|---|---|---|---|---|---|
> 1 |
returned more than the liability | 80 | 24.24% | +258.72% | +0.62720 |
0 .. 1 |
modest wins | 28 | 8.48% | +62.80% | +0.05329 |
= 0 |
scratched | 9 | 2.73% | 0.00% | 0.00000 |
−1 .. 0 |
partial losses | 13 | 3.94% | −66.86% | −0.02634 |
= −1 |
total losses | 200 | 60.61% | −100.00% | −0.60606 |
| Total | 330 | 100.00% | m = +0.04809 | ||
s_max = 2 × 0.04809 × 0.50 / (2.2775 × 2.9957) = 0.70% = €70.49
Now m is a believable 4.8% per unit of liability, in line with the observed 5.77% return. Three in
five
markets are total losses; one in four returns more than 2.5×. This is what a dutching session at long prices
looks like, and the stake falls to 0.70%.
Method 3 — Raw Outcomes
Drop the bands. Weight all 330 market results equally at their own return on liability and compute the moments directly.
s_max = 2 × 0.04809 × 0.50 / (3.0796 × 2.9957) = 0.52% = €52.13
The mean is identical to Method 2 — a probability-weighted mean does not care how finely you partition the outcomes. The variance is 35% higher. Banding replaced eighty individual wins ranging from +1.0 to +11.6 with a single value of +2.59, and two hundred losses with exactly −1; it threw away the spread within each band. The true per-market variance includes that spread, so the Raw stake is never higher than the banded one, and here it is a quarter lower.
Comparison and the Conservative Ceiling
| Method | m | v | s_max | Cash | Verdict |
|---|---|---|---|---|---|
| Wins and Losses | 7.18179 | 137.602 | 1.74% | €174.22 | discards size |
| Profit and Loss (banded) | 0.04809 | 2.278 | 0.70% | €70.49 | understates v |
| Raw Outcomes | 0.04809 | 3.080 | 0.52% | €52.13 | ceiling |
Wins-and-Losses is 2.5× the banded figure; banded is 1.4× Raw. The calculator reports the minimum of the three as the conservative ceiling. In practice that is always Raw, and the other two are there so you can see how much the shortcut methods would have over-staked you.
Ceiling Versus What Was Actually Staked
The per-market detail the script writes alongside the report makes one more comparison possible: the ceiling against the liabilities the trader actually carried.
The median market was staked at 82% of the ceiling; the mean market at 92% of it; the
largest at 485%. Caveat 1 says to stay comfortably underneath. This session was sitting close to the line
and periodically jumping over it. It was profitable in the period — but with a 5% lifetime chance of halving
at
s_max, and materially worse odds on the €250 markets, “profitable in the period” is
exactly what the 95% branch is supposed to look like.
Interactive Dashboard
To explore the ceiling across different parameters, we have created an interactive dashboard where you can:
- Load the three measured (m, v) pairs from this session, or type your own from your report
- Move the bank, the drawdown threshold and the risk tolerance
- See
s_max, the cash liability, and the round-trip RoR check update live - Read the ruin probability at multiples of the ceiling, with an Accept / Reduce / Avoid verdict
(Opens in a new window; allow popups if prompted)
How This Relates to TMDA
| TMDA (Feb 2026) | This calculator | |
|---|---|---|
| Input | One wager: P, O | A history: 330 market results |
| Staking | Fixed fraction of current bank (compounding) | Fixed fraction of starting bank per market (fixed stakes) |
| Space | Log-returns: μ, σ | Arithmetic P&L per unit liability: m, v |
| Horizon | Finite: n bets | Infinite: “ever” |
| Question | Is this stake survivable over n bets? | What is the largest stake that is survivable at all? |
| Decision | Accept / Reduce / Avoid | A ceiling; m ≤ 0 ⇒ ceiling is zero (Avoid) |
They are the same diffusion, asked two different questions. TMDA's finite horizon makes it less
pessimistic
than the “ever” version here; its compounding makes ruin in the strict sense impossible and so it
measures
drawdown instead, which is the same thing this calculator does with D.
The TMDA post's closing section on asymmetric payoffs is directly relevant. Whelan (2025) showed the diffusion approximation understates ruin when wins are rare and large. The Win session here has a 33% strike rate and winning selections at average odds of 25 — an asymmetry ratio of order K ≈ 24, far beyond the K = 9 example where diffusion missed by ten percentage points. So the 5% in “5% chance of halving at s_max” is best read as a lower bound; the discrete-chain figure will be materially higher. One more reason the number is a ceiling to stay under, not a target to reach.
Caveats
These travel with every result the script prints. Numbered so they can be cited.
- Treat
s_maxas a ceiling to stay comfortably underneath, not a target to reach. - Asks whether you will ever hit the drawdown, not whether you will hit it in the next N markets. Pessimistic on that axis.
- Measures drawdown from the starting balance, not the running peak, which flatters the result — on balance the number errs generous.
- Assumes the reported history represents the session you are about to trade.
- Assumes fixed stakes: no resizing or moving down as the bank moves.
- Treats an observed edge as the true edge; optimistic on small samples. 330 markets is not many for a 33% strike rate at long prices.
- Continuous approximation of discrete outcomes. With K ≈ 24 the approximation understates ruin (Whelan 2025).
- Wins-and-Losses discards outcome size, so it flatters a session of small wins and rare large losses. Prefer the size-weighted figures.
- Profit-and-Loss collapses each band onto its mean, understating variance. Raw Outcomes is the honest one; prefer that.
- If
m ≤ 0,s_maxis 0%: no positive stake is safe without an edge.
References
- Feller, W. (1971). An Introduction to Probability Theory and Its Applications, Vol. 2, Ch. XIV. Wiley.
- Ross, S. M. (1996). Stochastic Processes, 2nd ed. Wiley.
- Chen, B. & Ankenman, J. (2006). The Mathematics of Poker, Ch. 22. ConJelCo.
- Whelan, K. (2025). “Ruin Probabilities for Strategies with Asymmetric Risk.” University College Dublin. [PDF]
- matekus (2026). TMDA — Profitable, Sustainable, Survivable.
History Moments
Risk Parameters
Where m and v come from
Ceiling
| Stake | × s_max | Liability | RoR | Verdict |
|---|---|---|---|---|
| Calculate to populate | ||||
Interpretation Guide
Round-trip RoR: s_max fed back into the RoR equation; it should return r exactly. If it does not, an input is out of range.
Edge: whether m is positive. Without an edge no positive stake is safe and the ceiling is zero.
Verdict: Accept when RoR ≤ r; Reduce when r < RoR ≤ 2r; Avoid above that. The row at 1.00× is the ceiling itself and sits exactly on r.
Model Scope: infinite horizon, drawdown from the starting balance, fixed stakes, diffusion approximation. With rare large wins (K ≈ 24 on this history) the approximation understates ruin, so treat every RoR here as a lower bound.
Claude used for the final sanity check of the analysis and for the complete generation of the visual theme.
