Getting started
Install
Section titled “Install”Whale ships as a reef package. Install it from the Chelis-Lang GitHub org:
chelis reef install --from-github Chelis-Lang/whale@v0.1.13This pulls Whale and its transitive dependencies (chelis-std 0.4.0,
shoals 0.21.4) into your local reef cache.
First use: Kelly sizing
Section titled “First use: Kelly sizing”A minimal example that computes the optimal stake fraction using the Kelly criterion.
import Whale.Sizing exposing (kelly)import Whale.Types exposing (Probability, Odds)
let win_prob : Probability = Probability.from_float 0.55let decimal_odds : Odds = Odds.decimal 2.10
let fraction = kelly win_prob decimal_odds-- fraction ≈ 0.0738 (stake 7.38% of bankroll)kelly returns a StakeFraction value. The caller decides whether to apply
it directly or pass it through a fractional or capped variant before sizing
the actual stake in currency units.
Next steps
Section titled “Next steps”- Sizing covers all Kelly variants and simultaneous multi-bet sizing.
- Bankroll shows how to track balances and enforce drawdown limits.
- Risk and policy explains the guardrail and policy layers.
- Backtesting walks through strategy evaluation.