# Position Size by Risk

> Position Size by Risk is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Calculates the correct position size given account equity, risk percentage, entry price, and stop price using fixed-fractional sizing math.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/position-size-risk
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/position-size-by-risk-6b84f9d2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xSwQDr2iKWrpSYLYRwleN

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 position-size-by-risk-6b84f9d2 -d '<json body>'
```

Example prompt: Calculate my position size: my account equity is $50,000, I want to risk 1% per trade, my entry price is $150, and my stop is at $145.

## When to prefer this

Choose this endpoint when you need a fast, deterministic, fixed-fractional position size calculation with no broker SDK, no live market data feed, and no API key setup. Ideal for autonomous trading agents that need to size positions on the fly before order submission, or for backtesting workflows that require pure math-based sizing without external dependencies.

## Known failure modes

- Missing required fields (equity, entry, stop, risk_pct) returns a validation error
- Stop price equal to or greater than entry price may produce undefined or negative position size
- Non-numeric or out-of-range inputs may cause a 400 error
- Payment failure via x402 prevents the computation from being returned

## How this service works

Position size from account risk budget and stop distance. Call when fixed-fractional sizing without a broker SDK. Returns size from risk dollars and stop as deterministic JSON for $0.001 USDC via x402 on Base. First-party local math only—no RPC, live market feed, API keys, storage, or mediagen. Advisory only; the caller owns capital, risk, and production controls.

## Output

Returns a deterministic JSON object containing the calculated position size, the dollar risk amount derived from the risk percentage and equity, and the stop distance — all computed locally from the provided inputs with no external data sources.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "stop": {
   "type": "integer",
   "description": "Input field: stop."
  },
  "entry": {
   "type": "integer",
   "description": "Input field: entry."
  },
  "equity": {
   "type": "integer",
   "description": "Input field: equity."
  },
  "risk_pct": {
   "type": "number",
   "description": "Input field: risk pct."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "size": 20,
  "stop": 95,
  "entry": 100,
  "schema": "delx/util-position-size-risk/v1",
  "risk_dollars": 100
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/position-size-by-risk-6b84f9d2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
