# Agent Quant Position Sizing

> Agent Quant Position Sizing is a paid API for AI agents from agent-quant.annushka1190.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-13).

Calculates optimal position size for a trade given account balance, risk tolerance, and entry/stop-loss parameters using pure math — no market data feeds required.

## Facts

- Endpoint: POST https://agent-quant.annushka1190.workers.dev/v1/position-size
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-quant-position-sizing-1ea01a05
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_z0rB5KcjN7kh2fdxFv_dP

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 agent-quant-position-sizing-1ea01a05 -d '<json body>'
```

Example prompt: Calculate my position size: I have a $10,000 account, I'm willing to risk 2% per trade, my entry price is $42,000 and my stop loss is $40,500 — how many units should I buy?

## When to prefer this

Choose this endpoint when you need fast, pure-math position sizing with no external data dependencies or API key setup. Ideal for AI trading agents that already have market prices and need deterministic risk calculations on-demand, billed per-use in USDC. Prefer over spreadsheet tools or broker APIs when you need a lightweight, composable computation step in an automated pipeline.

## Known failure modes

- Missing required fields (entry price, stop loss, account balance) returns a validation error
- Stop loss equal to or above entry price for a long (or below for a short) may cause a divide-by-zero or invalid result
- Malformed JSON body returns a 400-level error
- Payment failure via x402 (insufficient USDC balance) returns a 402 Payment Required
- Extreme input values (zero account balance, negative prices) may return an error or nonsensical result

## How this service works

Pure quant math for AI trading agents: percent change, position sizing, rough liquidation price, DCA schedule, APR/APY. No market data feeds, no API keys. Pay-per-request USDC via x402 on Base and Solana.

## Output

Returns a JSON object with the computed position size in units, the dollar amount at risk, and potentially the notional value of the position — derived purely from the mathematical relationship between account size, risk percentage, entry, and stop-loss price.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "body": {
     "type": "object"
    },
    "type": {
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "const": "json"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-quant-position-sizing-1ea01a05/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-quant.annushka1190.workers.dev](https://www.zero.xyz/host/agent-quant.annushka1190.workers.dev/llms.txt)
