# QuantOracle Crypto Leverage Check

> QuantOracle Crypto Leverage Check is a paid API for AI agents from api.quantoracle.dev, paid per call via x402, $0.015/call, status unknown (last checked 2026-09-15).

Analyzes a leveraged crypto position to compute VaR, CVaR, Kelly criterion leverage, liquidation price, and risk flags given returns history and position parameters

## Facts

- Endpoint: POST https://api.quantoracle.dev/v1/crypto/leverage-check
- Price: $0.015/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/quantoracle-crypto-leverage-check-596b6479
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_2jNVdIYLzBpzvCDlMxBDK

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 quantoracle-crypto-leverage-check-596b6479 -d '<json body>'
```

Example prompt: Check my leveraged BTC long position for liquidation risk and Kelly optimal leverage — I entered at $45,000 with $2,000 collateral on a $10,000 position size and a maintenance margin of 0.5%, using these recent daily returns: [0.02, -0.01, 0.015, -0.005, 0.03, 0.01, -0.02, 0.025, 0.005, -0.015, 0.012], and give me VaR at 95% and 99% confidence over a 1-day holding period.

## When to prefer this

Choose this endpoint when you need a comprehensive, single-call risk assessment of a leveraged crypto position covering VaR, CVaR, liquidation proximity, and Kelly sizing simultaneously. It is ideal for pre-trade checks, portfolio monitoring, and risk reporting workflows where both statistical risk metrics and practical liquidation thresholds are required. Prefer this over a generic VaR calculator when you also need Kelly criterion leverage guidance and liquidation price specific to crypto perpetual or margin positions.

## Known failure modes

- Insufficient returns array length may produce unreliable VaR estimates
- Position size smaller than collateral may return invalid leverage values
- Unsupported asset symbol returns a 400 or empty asset field
- Confidence levels outside [0,1) may cause computation errors
- Zero or negative entry_price or collateral triggers validation failure
- Truncated or malformed JSON body returns 422 unprocessable entity

## How this service works

QuantOracle: /v1/crypto/leverage-check

## Output

Returns a structured object with: per-confidence-level VaR and CVaR in both percentage and USD; annualized volatility; liquidation price and distance percentage; max loss before liquidation in USD; current leverage ratio; full and half Kelly optimal leverage values; and a list of risk flags (e.g. 'liquidation_distance_elevated', 'paying_funding') indicating actionable warnings about the position.

## Example request

```json
{
 "input": {
  "body": {
   "asset": "BTC",
   "returns": [
    0.02,
    -0.01,
    0.015,
    -0.005,
    0.03,
    0.01,
    -0.02,
    0.025,
    0.005,
    -0.015,
    0.012
   ],
   "direction": "long",
   "collateral": 2000,
   "entry_price": 45000,
   "position_size": 10000,
   "confidence_levels": [
    0.95,
    0.99
   ],
   "holding_period_days": 1,
   "maintenance_margin_rate": 0.005
  },
  "type": "http",
  "method": "POST",
  "bodyType": "json"
 }
}
```

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "title": "CryptoLeverageCheckIn",
     "required": [
      "asset",
      "direction",
      "entry_price",
      "position_size",
      "collateral",
      "returns"
     ],
     "properties": {
      "asset": {
       "type": "string",
       "title": "Asset",
       "description": "Crypto asset symbol (BTC, ETH, SOL...) — drives the live funding rate + carry"
      },
      "returns": {
       "type": "array",
       "items": {
        "type": "number"
       },
       "title": "Returns",
       "minItems": 10,
       "description": "Daily return series for the asset (>=10) — drives VaR/CVaR + Kelly"
      },
      "direction": {
       "enum": [
        "long",
        "short"
       ],
       "type": "string",
       "title": "Direction",
       "description": "Position direction"
      },
      "collateral": {
       "type": "number",
       "title": "Collateral",
       "description": "Collateral backing the position (USD)",
       "exclusiveMinimum": 0
      },
      "mark_price": {
       "anyOf": [
        {
         "type": "number",
         "exclusiveMinimum": 0
        },
        {
         "type": "null"
        }
       ],
       "title": "Mark Price",
       "description": "Current mark price (defaults to entry_price)"
      },
      "entry_price": {
       "type": "number",
       "title": "Entry Price",
       "description": "Entry price (USD)",
       "exclusiveMinimum": 0
      },
      "position_size": {
       "type": "number",
       "title": "Position Size",
       "description": "Notional position size (USD)",
       "exclusiveMinimum": 0
      },
      "confidence_levels": {
       "type": "array",
       "items": {
        "type": "number"
       },
       "title": "Confidence Levels",
       "default": [
        0.95,
        0.99
       ],
       "description": "VaR/CVaR confidence levels"
      },
      "holding_period_days": {
       "type": "integer",
       "title": "Holding Period Days",
       "default": 1,
       "minimum": 1,
       "description": "VaR holding period in days"
      },
      "maintenance_margin_rate": {
       "type": "number",
       "title": "Maintenance Margin Rate",
       "default": 0.005,
       "minimum"
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/quantoracle-crypto-leverage-check-596b6479/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)
