# finmath Perpetual Futures Liquidation Price Calculator

> finmath Perpetual Futures Liquidation Price Calculator is a paid API for AI agents from finmath.qzqh5rrbkz.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

Calculates the liquidation price for a perpetual futures (perp) position given side, leverage, entry price, and optional maintenance margin rate

## Facts

- Endpoint: POST https://finmath.qzqh5rrbkz.workers.dev/v1/perp_liquidation_price
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/finmath-perpetual-futures-liquidation-price-calculator-572c41a0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_x7Wxiqdy-rgFoVQXMyoab

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 finmath-perpetual-futures-liquidation-price-calculator-572c41a0 -d '<json body>'
```

Example prompt: I opened a long perp position on BTC at an entry price of $65,000 with 10x leverage — what's my liquidation price? Use a 0.5% maintenance margin rate.

## When to prefer this

Use this endpoint when you need exact, deterministic liquidation price arithmetic for perpetual futures positions — especially when an LLM's approximation is unacceptable for risk management decisions. Prefer this over manual calculation or LLM estimation when precision matters for trading safety or automated risk alerts.

## Known failure modes

- Missing required fields (side, leverage, entry_price) returns 400 error
- Invalid side value (not 'long' or 'short') causes computation error
- Leverage of 0 or negative causes division error
- Entry price of 0 or negative is invalid
- Maintenance margin rate outside 0-1 range may produce nonsensical result
- Payment of 0.002 USDC not provided results in 402 Payment Required

## How this service works

Deterministic finance and crypto math for AI agents: TradFi (NPV, IRR, XIRR, Black-Scholes + Greeks, bonds, VaR, Sharpe) and DeFi (impermanent loss, perp liquidation, funding, Uniswap v3, health factor, cost basis). Exact, model-free arithmetic that LLMs get wrong — priced per call in USDC.

## Output

Returns a result object containing the computed liquidation price for the perpetual futures position, along with a meta object containing calculation details such as the model used and input echo.

## Example request

```json
{
 "side": "long",
 "leverage": 10,
 "entry_price": 50000,
 "maintenance_margin_rate": 0.05
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "side",
  "leverage",
  "entry_price"
 ],
 "properties": {
  "side": {
   "type": "string",
   "description": "side"
  },
  "leverage": {
   "type": "number",
   "description": "leverage"
  },
  "entry_price": {
   "type": "number",
   "description": "entry_price"
  },
  "maintenance_margin_rate": {
   "type": "number",
   "description": "maintenance_margin_rate"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "result",
  "meta"
 ],
 "properties": {
  "meta": {
   "type": "object"
  },
  "result": {}
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/finmath-perpetual-futures-liquidation-price-calculator-572c41a0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from finmath.qzqh5rrbkz.workers.dev](https://www.zero.xyz/host/finmath.qzqh5rrbkz.workers.dev/llms.txt)
