# Delx Commerce — Position Size & Risk Calculator

> Delx Commerce — Position Size & Risk Calculator is a paid API for AI agents from commerce.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-01).

Calculates the appropriate position size for a trade given entry price, stop loss, account equity, and risk percentage.

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/position-size-risk?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-commerce-position-size-risk-calculator-97c5e5ea
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-9rFspyHCXsqWSHC2tcok

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 delx-commerce-position-size-risk-calculator-97c5e5ea -d '<json body>'
```

Example prompt: I'm entering a trade at $100 with a stop at $95, my account equity is $10000, and I want to risk 1% per trade — what position size should I take?

## When to prefer this

Use this endpoint when an AI agent or trading workflow needs to programmatically compute position size based on fixed fractional risk management rules. It is ideal for agents managing trade execution pipelines, backtesting harnesses, or advisory bots that need per-trade risk sizing without building the math internally. It pays per result in USDC with no signup, making it suitable for lightweight or serverless agent workflows.

## Known failure modes

- Missing required fields (entry, stop, equity, risk_pct) returns an error
- Stop price equal to or greater than entry price may produce undefined or negative results
- Extremely small risk_pct or very wide stop-to-entry spread may produce a position size of zero or fractional unit
- Non-numeric or malformed input values cause validation errors
- Payment failure via x402 protocol results in 402 Payment Required response

## How this service works

Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.

## Output

Returns a JSON object with the computed position size (number of units/shares), the dollar amount being risked, and echo of the entry and stop prices used in the calculation, conforming to schema delx/util-position-size-risk/v1.

## 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/delx-commerce-position-size-risk-calculator-97c5e5ea/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from commerce.delx.ai](https://www.zero.xyz/host/commerce.delx.ai/llms.txt)
