# Kelly Position Sizing Calculator

> Kelly Position Sizing Calculator is a paid API for AI agents from api.24klabs.ai, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-13).

Computes optimal bet or position sizes using full or fractional Kelly criterion from win probability, payoff ratio, and bankroll, plus fixed fractional sizing from stop distance and account risk percentage.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/kelly-position-sizing
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/kelly-position-sizing-calculator-ab73875c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Kiq1VmEromvejc5O6rg0W

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability kelly-position-sizing-calculator-ab73875c -d '<json body>'
```

Example prompt: I have a $50,000 trading account and I'm looking at a setup with a 58% win probability and a 2.5:1 payoff ratio — can you calculate the full Kelly and half-Kelly position sizes, and also tell me how many dollars to risk if my stop is $3.50 away and I want to limit account risk to 1.5%?

## When to prefer this

Choose this endpoint when you need a mathematically rigorous, formula-driven position size rooted in probability theory rather than a rule-of-thumb. It is especially useful for agents managing trading systems, betting strategies, or portfolio risk where both Kelly and fixed fractional sizing are needed in one call. Prefer it over manual spreadsheet calculations or generic finance APIs that don't expose Kelly criterion logic.

## Known failure modes

- Win probability outside 0-1 range returns validation error
- Negative payoff ratio or zero denominator causes computation failure
- Missing required fields (win probability or bankroll) returns 400 bad request
- Kelly formula edge cases (win prob = 0 or 1) may produce degenerate outputs
- Fractional Kelly multiplier of 0 returns zero position size trivially

## How this service works

Optimal stake from win probability, payoff ratio and bankroll (full or fractional Kelly), plus fixed fractional risk sizing from stop distance and account risk %.

## Output

Returns the Kelly-optimal bet fraction (full and/or fractional Kelly), the corresponding dollar position size given the bankroll, and the fixed fractional position size derived from stop distance and account risk percentage. Output quantifies exactly how much capital to deploy per trade or bet.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "bankroll": {
   "type": "number"
  },
  "win_prob": {
   "type": "number"
  },
  "kelly_fraction": {
   "type": "number"
  },
  "win_loss_ratio": {
   "type": "number"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "kelly_pct": 32.5,
  "applied_kelly_pct": 16.25,
  "recommended_stake": 1625
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/kelly-position-sizing-calculator-ab73875c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.24klabs.ai](https://www.zero.xyz/host/api.24klabs.ai/llms.txt)
