# QuantOracle Risk Position Size Calculator

> QuantOracle Risk Position Size 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 optimal position size, share count, risk exposure, and 2R target price given entry price, stop loss, account size, and risk percentage per trade

## Facts

- Endpoint: POST https://api.quantoracle.dev/v1/risk/position-size
- 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-560b0ff8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lwH8YI_9SDgtk9U7D5fZI

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-560b0ff8 -d '<json body>'
```

Example prompt: I'm entering a trade at $150 with a stop loss at $145, my account is $50,000 and I want to risk 2% per trade — how many shares should I buy and what's my 2R profit target?

## When to prefer this

Use this endpoint when you need fast, deterministic position sizing calculations based on fixed-risk methodology — especially for equities or any instrument where you know the entry price and stop loss. Preferred over manual calculation or general-purpose math tools when you need the full risk summary (shares, position value, max loss, 2R target) in a single call.

## Known failure modes

- stop_loss >= entry_price returns validation error
- risk_per_trade > 1.0 or negative values return 400 bad request
- account_size of zero or negative triggers error
- missing required fields return 422 unprocessable entity
- network timeout or service unavailability returns 5xx

## How this service works

QuantOracle: risk/position-size

## Output

Returns the number of shares to buy, total position value, dollar risk amount, max loss, the 2R target price, and the percentage of account at risk — all computed in ~12ms

## Example request

```json
{
 "risk_pct": 0.02,
 "stop_loss": 145,
 "entry_price": 150,
 "account_size": 50000
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "stop_loss": {
   "type": "number",
   "title": "Stop Loss",
   "description": "Stop loss price"
  },
  "entry_price": {
   "type": "number",
   "title": "Entry Price",
   "description": "Planned entry price"
  },
  "account_size": {
   "type": "number",
   "title": "Account Size",
   "description": "Total account value"
  },
  "risk_per_trade": {
   "type": "number",
   "title": "Risk Per Trade",
   "default": 0.02,
   "description": "Maximum risk per trade as fraction (e.g. 0.02 = 2%)"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-quantoracle-dev-560b0ff8/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)
