# QuantOracle Crypto Liquidation Price Calculator

> QuantOracle Crypto Liquidation Price Calculator is a paid API for AI agents from api.quantoracle.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Calculates the liquidation price for a leveraged crypto position given entry price, collateral, position size, leverage, direction, and maintenance margin rate

## Facts

- Endpoint: POST https://api.quantoracle.dev/v1/crypto/liquidation-price
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-quantoracle-dev-4b1d5d60
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_htvHqGuvbCF1y_KvmKE-k

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 api-quantoracle-dev-4b1d5d60 -d '<json body>'
```

Example prompt: What's my liquidation price if I open a long BTC position at $65,000 entry with $1,000 collateral, $10,000 position size, 10x leverage, and a 0.5% maintenance margin rate?

## When to prefer this

Use this endpoint when you need a precise, fast calculation of the liquidation price for a single leveraged crypto position — especially when building risk dashboards, trade validators, or position-sizing tools where you need the exact liquidation level and supporting metrics like safe price range and max loss.

## Known failure modes

- Missing required fields (leverage, direction, collateral, entry_price, position_size, maintenance_margin_rate) returns 400 error
- Invalid direction value (not 'long' or 'short') returns validation error
- Zero or negative collateral or position size returns error
- Leverage value out of acceptable range returns error
- Payment failure via x402 protocol returns 402 Payment Required

## How this service works

QuantOracle: crypto/liquidation-price

## Output

Returns the exact liquidation price, the percentage distance from entry to liquidation, a safe price range (min and max), the maximum dollar loss before liquidation, current margin ratio, effective leverage, and direction — all computed in about 11ms.

## Example request

```json
{
 "leverage": 10,
 "direction": "long",
 "collateral": 1000,
 "entry_price": 50000,
 "position_size": 10000,
 "maintenance_margin_rate": 0.005
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "leverage": {
   "type": "number",
   "title": "Leverage",
   "description": "Leverage multiplier"
  },
  "direction": {
   "enum": [
    "long",
    "short"
   ],
   "type": "string",
   "title": "Direction",
   "description": "Position direction"
  },
  "collateral": {
   "type": "number",
   "title": "Collateral",
   "description": "Collateral amount in USD"
  },
  "entry_price": {
   "type": "number",
   "title": "Entry Price",
   "description": "Position entry price"
  },
  "position_size": {
   "type": "number",
   "title": "Position Size",
   "description": "Total position size in USD"
  },
  "funding_accumulated": {
   "type": "number",
   "title": "Funding Accumulated",
   "default": 0,
   "description": "Accumulated funding payments (negative = paid)"
  },
  "maintenance_margin_rate": {
   "type": "number",
   "title": "Maintenance Margin Rate",
   "default": 0.005,
   "description": "Maintenance margin rate (e.g. 0.005 = 0.5%)"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-quantoracle-dev-4b1d5d60/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)
