Kelly sizing
The idea behind the portfolio allocator's bet sizes, how a strategy's record becomes a size multiplier, and why it is held back.
The Kelly bet is an old answer to a simple question: if you have an edge, how much of your bankroll should you bet each time? Bet too little and you leave growth on the table. Bet too much and a run of losses wipes you out, even with an edge. The portfolio allocator uses a cautious version of it to size each strategy's buys by what that strategy has earned.
The idea#
For a bet you win with probability p, where a win pays b times what a loss costs, the Kelly share of the bankroll is:
Kelly = p − (1 − p) ÷ b
- A strategy that wins 40% of its trades, with average wins three times its average losses: 0.4 − 0.6 ÷ 3 = 0.2. Kelly says bet 20% of the bankroll.
- A strategy that wins 50%, with wins the same size as losses: 0.5 − 0.5 ÷ 1 = 0. No edge, no bet.
- Below zero means the odds are against you.
How the allocator uses it#
For each running strategy, the allocator takes its closed trades from the last 90 days, in the strategy's current mode (paper trades for a paper strategy, live for a live one), each as a return after fees.
- Learning first. With fewer than 10 closed trades (the default), the size stays ×1: "Learning (6 of 10 trades)".
- A careful win rate. The win rate is pulled toward 50% while trades are few: (wins + 1) ÷ (trades + 2). With 3 wins in 4 trades, it uses 67%, not 75%.
- The odds. The average winning return divided by the average losing return. If there has been no losing trade yet, it assumes a loss as big as the average win, the cautious answer.
- The Kelly bet, from those two.
- A multiplier, not a bankroll share. The Kelly bet is divided by a reference (0.2 by default). A strategy whose Kelly bet is 20% trades its own size (×1), one at 40% trades ×2, one at 10% trades ×0.5.
- Limits. The multiplier is held between ×0.25 and ×2 (the defaults).
- No edge yet. A strategy with a Kelly bet of zero or less keeps the smallest size (×0.25), so it keeps learning. The health monitor is what stops a strategy that has drifted, not the allocator.
The multiplier applies to the strategy's own size, and the buy is still held to your per-order cap.
An example#
A strategy has 20 closed trades: 8 wins averaging +60%, 12 losses averaging −25%.
- Win rate: (8 + 1) ÷ (20 + 2) = 41%.
- Odds: 60 ÷ 25 = 2.4.
- Kelly: 0.409 − 0.591 ÷ 2.4 = 0.163.
- Multiplier: 0.163 ÷ 0.2 = ×0.82.
Its 0.1 SOL size becomes 0.082 SOL.
Why "fractional"#
Full Kelly assumes you know your win rate and odds exactly. From a few dozen memecoin trades you don't: one lucky 20× can make a strategy look far better than it is. Full Kelly on a wrong estimate overbets. That is why the allocator:
- shrinks the win rate toward 50% while trades are few,
- maps Kelly to a multiplier of the size you chose, instead of betting a share of the bankroll,
- caps the multiplier at ×2.
The book limits#
Sizing each strategy isn't enough when several run at once. With the allocator on, every buy also has to fit the whole book:
- Max exposure: all open positions together at most 60% of equity (the default).
- Positions per dev: at most 1 open position in tokens from the same dev (the default). One dev's tokens tend to rug together.
- One strategy per token: skip a token another of your positions already holds (on by default).
A buy that breaks one is skipped with a reason starting "Allocator:".
Good to know#
- The past isn't the future. Kelly sizes by what a strategy did. If its edge was luck or has gone, the allocator only notices as new trades come in.
- It is off by default. Turn it on with Size by track record on Strategies.