Kelly Size Gate
size_gateDeterministic position sizing (fractional Kelly) + risk-of-ruin. Given an edge — discrete {winProb, winLossRatio} or continuous {expectedReturn, volatility} — and a bankroll, returns the fractional-Kelly size and the probability of ever drawing down to 50/75/90%. The direct antidote to over-betting: full Kelly rides thin edges to ruin; this defaults to quarter-Kelly. Call before sizing ANY position.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| winProb | No | discrete mode: win probability in (0,1) | |
| bankroll | No | bankroll in account units — recommended sizes are returned in the same units | |
| volatility | No | continuous mode: volatility per period (sigma) | |
| winLossRatio | No | discrete mode: net win/loss odds b | |
| kellyFraction | No | fraction of full Kelly to bet (default 0.25) | |
| expectedReturn | No | continuous mode: excess return per period (mu) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | false when the engine rejected the input | |
| mode | No | discrete or continuous | |
| note | No | plain-language guidance | |
| model | No | model assumptions used | |
| proof | No | Verifiability envelope: echoed inputs, engine codeHash, contentHash of this exact result, self-checks, EIP-712 signature (EAS-ready). Re-run the open engine on `inputs` to reproduce the result byte-for-byte. | |
| checks | No | Ground-truth self-checks; the result is untrustworthy if any fails. | |
| hasEdge | No | false when the edge is non-positive (bet nothing) | |
| leverage | No | implied leverage of the recommended size | |
| riskOfRuin | No | probability of ever drawing down to 50/75/90% of bankroll | |
| recommendedSize | No | recommended bet size in bankroll units | |
| expectedLogGrowth | No | expected log-growth rate at the recommended size | |
| fullKellyFraction | No | full-Kelly fraction of bankroll (the ruinous ceiling, not the recommendation) | |
| kellyFractionUsed | No | fraction of full Kelly applied (default 0.25) | |
| impliedPortfolioVolPct | No | portfolio volatility implied by the recommended size (%) | |
| recommendedBetFraction | No | recommended bet as a fraction of bankroll |