# Risk/Reward Ratio Calculator

> Risk/Reward Ratio Calculator 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).

Computes the risk-reward ratio (reward divided by risk) for a given trade setup defined by entry, stop-loss, and take-profit levels.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/risk-reward
- 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/risk-reward-ratio-calculator-602c2324
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FaSFyvNThzZK4JM5Tc22y

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 risk-reward-ratio-calculator-602c2324 -d '<json body>'
```

Example prompt: What's the risk-reward ratio for a trade where my entry is 200, stop is 190, and take-profit is 230?

## When to prefer this

Choose this endpoint when you need a fast, deterministic, serverless calculation of risk-reward ratio with no API keys or live market data dependency. Ideal for trading bots or agents that need to validate setups programmatically before committing to position sizing. Prefer it over manual calculation or spreadsheet logic when running in an automated agent pipeline that requires structured JSON output at $0.001 per call.

## Known failure modes

- Missing required fields (entry, stop, or take) returns an error
- Stop equal to entry results in division by zero or error
- Inverted stop/take geometry (stop above entry for a long) may return negative or unexpected ratio
- Integer-only inputs may lose precision for fractional price levels
- Payment failure via x402 prevents endpoint access

## How this service works

Risk–reward ratio = reward / risk for stop/target geometry. Call when validating setups before size allocation. Returns risk_reward ratio 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 computed risk_reward ratio as a numeric value, calculated as (take - entry) / (entry - stop) for a long trade, using only local arithmetic with no external data sources.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "stop": {
   "type": "integer",
   "description": "Input field: stop."
  },
  "take": {
   "type": "integer",
   "description": "Input field: take."
  },
  "entry": {
   "type": "integer",
   "description": "Input field: entry."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "risk": 5,
  "reward": 15,
  "schema": "delx/util-risk-reward/v1",
  "risk_reward": 3
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/risk-reward-ratio-calculator-602c2324/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)
