A real edge can still go broke. Watch 10,000 tries at once.
Bankroll runs 10,000 Monte-Carlo equity paths in a Web Worker and fans them out live. Drag the bet-size slider and the risk-of-ruin counter reacts instantly; flip on Kelly and the whole fan tightens.
Give me a coin that lands heads 55% of the time, pay me even money when it does, and let me bet on it two hundred times. That is a genuine edge, the kind a real bettor would kill for. Now let me stake 40% of my bankroll on every flip. A large share of those runs end with me flat broke. The edge was never the problem. The sizing was.
That gap between "I have an edge" and "I still went bankrupt" is invisible in the one number people actually reason with: expected value. Plus 5% per bet on average sounds like a slow, safe climb. The average is a liar. It hides the shape of the outcomes, and the shape is where ruin lives.
What it is
Bankroll makes the shape visible. You set your edge (win probability and payout ratio), your bet size, and how many bets you want to live through, and it runs the strategy 10,000 times in parallel simulated universes, all starting from the same bankroll. It plots every one of those 10,000 equity curves at once as a fan chart. The width of the fan is your variance. The fraction of the fan that touches zero is your risk of ruin, printed big at the top and counting up or down the instant you move a slider.
It is built for people who size wagers by gut feel: sports bettors with a perceived edge, retail traders stress-testing a position rule before real capital is on it, poker players who want intuition for variance instead of a textbook derivation. None of them want to read a paper on the Kelly criterion. They want to drag a slider and see their future.
How it actually works
The 10,000 paths run in a Web Worker, not on the main thread, and that decision is the whole product. Ten thousand paths times a few hundred bets each is enough arithmetic that doing it inline would freeze the page mid-drag. A frozen slider kills the one thing that makes the tool teach anything: the tight loop between moving your hand and watching the fan reshape. Cause and effect have to be inseparable. Bigger bets, wider fan, higher ruin, immediately, every time. So the math ships off to a worker thread and the fan redraws within a frame or two of your input while the UI stays liquid.
Then there is the Kelly toggle, which is the actual "aha." The Kelly criterion is the bet size that maximizes long-run growth for a given edge, and at even money on a 55% coin it works out to about 10% of bankroll, not 40%. Bankroll does not present that as a formula in a sidebar. It is a switch on the same fan chart you are already staring at. Flip "Snap to Kelly" at the same edge and the fan pulls in, the percentile bands hug the center, and the ruin counter collapses toward zero. Same expected value, wildly different chance of survival, purely from how much you put on each flip.
The number that never lands on zero
Here is a gotcha that shows up the moment you build this. Proportional betting
scales your stake to your current bankroll, so a losing streak decays it
multiplicatively: you never subtract your way to exactly 0, you asymptote toward it
and floating-point math keeps handing you 0.0000003. If "ruin" meant a literal zero
balance, almost nothing would ever count as ruined and the counter would lie in the
optimistic direction. So RUIN_THRESHOLD in the sim treats "close enough to broke
to never recover" as broke. It is a small choice, but it is the difference between a
ruin readout that means something and one that is technically true and practically
useless.
The math lives in pure functions with no DOM and no worker plumbing tangled in, so the whole simulation is tested under Node's built-in runner with no browser. The app itself is static files, no backend and no build step, which is why it hosts from a plain subpath.
Try it
Open the overbetting scenario: a real 55% edge at even money, staked at 40%, with a startling number of paths on the floor. Then flip Snap to Kelly and watch the ruin counter fall off a cliff without touching the edge. Every slider is encoded in the URL, so any view you land on is a link you can send to the friend who insists their win rate makes them safe.
This post is part of the build log: every app my automated factory ships gets written up here, honestly. Browse everything at apps.charliekrug.com. Comments are open below.
Loading comments…