# QuantOracle Barrier Option Pricer

> QuantOracle Barrier Option Pricer is a paid API for AI agents from api.quantoracle.dev, paid per call via x402, $0.008/call, status unknown (last checked 2026-09-14).

Prices barrier options (knock-in/knock-out) with full Greeks, comparing against vanilla option price and computing the discount

## Facts

- Endpoint: POST https://api.quantoracle.dev/v1/derivatives/barrier-option
- Price: $0.008/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-0568fecd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_5aahYG40TwHQUlcoUl9D_

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-0568fecd -d '<json body>'
```

Example prompt: Price a down-and-out call barrier option where the spot is 100, strike is 105, barrier is 90, 6 months to expiry, 5% risk-free rate, 0% dividend yield, and 20% volatility — and tell me how much cheaper it is versus the plain vanilla equivalent.

## When to prefer this

Use this endpoint when you need to price a single European-style barrier option (knock-in or knock-out, call or put) and want both the barrier price and a comparison against the vanilla equivalent. Ideal for structured product valuation, exotic derivatives desks, or risk analysis workflows that need fast, on-demand barrier pricing without running a local quant library.

## Known failure modes

- Invalid barrier_type enum value returns a 400 error
- Barrier level placed beyond spot in invalid direction for the selected barrier type
- Zero or negative time to expiry (T <= 0) causes computation error
- Missing required fields (S, K, H, T, sigma) returns validation error
- Extreme volatility or rate values may cause numerical instability
- Payment not attached or insufficient USDC balance returns 402

## How this service works

QuantOracle: derivatives/barrier-option

## Output

Returns the fair value price of the barrier option, the equivalent vanilla option price, the discount versus vanilla (as a ratio), barrier level, barrier type, and server computation time in milliseconds.

## Example request

```json
{
 "input": {
  "body": {
   "H": 90,
   "K": 105,
   "S": 100,
   "T": 0.5,
   "q": 0,
   "r": 0.05,
   "type": "call",
   "sigma": 0.2,
   "rebate": 0,
   "barrier_type": "down-out"
  },
  "type": "http",
  "method": "POST",
  "bodyType": "json"
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "H": {
   "type": "number",
   "title": "H",
   "description": "Barrier level",
   "exclusiveMinimum": 0
  },
  "K": {
   "type": "number",
   "title": "K",
   "description": "Strike price",
   "exclusiveMinimum": 0
  },
  "S": {
   "type": "number",
   "title": "S",
   "description": "Spot price of the underlying asset",
   "exclusiveMinimum": 0
  },
  "T": {
   "type": "number",
   "title": "T",
   "maximum": 30,
   "description": "Time to expiration in years",
   "exclusiveMinimum": 0
  },
  "q": {
   "type": "number",
   "title": "Q",
   "default": 0,
   "description": "Continuous dividend yield"
  },
  "r": {
   "type": "number",
   "title": "R",
   "default": 0.05,
   "description": "Risk-free interest rate (annualized)"
  },
  "type": {
   "enum": [
    "call",
    "put"
   ],
   "type": "string",
   "title": "Type",
   "default": "call",
   "description": "Option type"
  },
  "sigma": {
   "type": "number",
   "title": "Sigma",
   "description": "Volatility (annualized)",
   "exclusiveMinimum": 0
  },
  "rebate": {
   "type": "number",
   "title": "Rebate",
   "default": 0,
   "description": "Rebate paid if barrier is hit (for out) or not hit (for in)"
  },
  "barrier_type": {
   "enum": [
    "up-in",
    "up-out",
    "down-in",
    "down-out"
   ],
   "type": "string",
   "title": "Barrier Type",
   "default": "down-out",
   "description": "Barrier type: up/down + in/out"
  }
 }
}
```

## More

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