# QuantOracle Kelly Criterion Calculator

> QuantOracle Kelly Criterion Calculator is a paid API for AI agents from api.quantoracle.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Calculates Kelly Criterion position sizing (full, half, and quarter Kelly fractions) given win rate, average win, average loss, and mode

## Facts

- Endpoint: POST https://api.quantoracle.dev/v1/risk/kelly
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-quantoracle-dev-13de8db9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_GfO0NsxQpogmmy6tQBXBV

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 api-quantoracle-dev-13de8db9 -d '<json body>'
```

Example prompt: Using discrete mode, calculate my Kelly position size — my average win is $200, average loss is $100, and my win rate is 55%. Tell me the full, half, and quarter Kelly fractions and which one is recommended.

## When to prefer this

Use this endpoint when you need a mathematically rigorous, low-latency Kelly Criterion position sizing calculation for discrete trading outcomes — especially when you have a defined win rate, average win, and average loss. Prefer this over manual calculation or generic finance APIs when you want a structured recommendation (QUARTER_KELLY, HALF_KELLY, FULL_KELLY) alongside edge and payoff metrics. Part of the QuantOracle suite, making it easy to chain with sharpe ratio, regime classification, or full risk analysis endpoints.

## Known failure modes

- win_rate outside 0-1 range returns validation error
- avg_win or avg_loss of zero or negative causes division error
- missing required fields returns 400 bad request
- win_rate of 0 or 1 (no uncertainty) may return degenerate Kelly values
- invalid mode string returns unrecognized mode error

## How this service works

QuantOracle: risk/kelly

## Output

Returns edge percentage, payoff ratio, full Kelly fraction, half Kelly fraction, quarter Kelly fraction, and a recommended Kelly sizing level (e.g. QUARTER_KELLY) along with response time in milliseconds.

## Example request

```json
{
 "input": {
  "body": {
   "mode": "discrete",
   "avg_win": 200,
   "avg_loss": 100,
   "win_rate": 0.55
  },
  "type": "http",
  "method": "POST",
  "bodyType": "json"
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "mode": {
   "enum": [
    "discrete",
    "continuous"
   ],
   "type": "string",
   "title": "Mode",
   "default": "discrete",
   "description": "Calculation mode: discrete (win/loss) or continuous (return series)"
  },
  "avg_win": {
   "anyOf": [
    {
     "type": "number"
    },
    {
     "type": "null"
    }
   ],
   "title": "Avg Win",
   "description": "Average win amount, required for discrete mode"
  },
  "returns": {
   "anyOf": [
    {
     "type": "array",
     "items": {
      "type": "number"
     }
    },
    {
     "type": "null"
    }
   ],
   "title": "Returns",
   "description": "Array of historical returns, required for continuous mode"
  },
  "avg_loss": {
   "anyOf": [
    {
     "type": "number"
    },
    {
     "type": "null"
    }
   ],
   "title": "Avg Loss",
   "description": "Average loss amount (positive number), required for discrete mode"
  },
  "win_rate": {
   "anyOf": [
    {
     "type": "number"
    },
    {
     "type": "null"
    }
   ],
   "title": "Win Rate",
   "description": "Probability of winning (0-1), required for discrete mode"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-quantoracle-dev-13de8db9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.quantoracle.dev](https://www.zero.xyz/host/api.quantoracle.dev/llms.txt)
