# QuantOracle Transaction Cost Analysis

> QuantOracle Transaction Cost Analysis is a paid API for AI agents from api.quantoracle.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Computes detailed transaction cost breakdown for a trade including spread cost, market impact, commission, round-trip cost, and breakeven move percentage

## Facts

- Endpoint: POST https://api.quantoracle.dev/v1/risk/transaction-cost
- Price: $0.005/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-9f17da5e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JiBut5lBQklsWf9dkfjSe

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-9f17da5e -d '<json body>'
```

Example prompt: What are the full transaction costs for buying 10,000 shares of a stock with a $500,000 trade value, ADV of $10 million, spread of 5 bps, market impact of 8 bps, commission of 0.02%, and a participation rate of 20%?

## When to prefer this

Use this endpoint when you need a full decomposition of transaction costs for a single equity trade — specifically when you need spread cost, market impact, commission, and round-trip cost all broken down with a breakeven move calculation. Prefer this over generic slippage estimators when you have ADV, participation rate, and spread data available and need precise bps-level cost attribution.

## Known failure modes

- Missing required fields (adv, shares, trade_value) returns validation error
- Negative or zero values for share count or trade value may return computation error
- Participation rate outside 0-1 range may return invalid input error
- Commission percentage expressed as decimal vs percentage may yield unexpected results

## How this service works

QuantOracle: risk/transaction-cost

## Output

Returns a detailed cost breakdown including: total cost in basis points, spread cost in USD, market impact in USD, commission in USD, total cost in USD, cost as a percentage of trade value, round-trip cost in bps and USD, breakeven move percentage, and computation latency in milliseconds.

## Example request

```json
{
 "adv": 10000000,
 "shares": 10000,
 "spread_bps": 5,
 "trade_value": 500000,
 "commission_pct": 0.02,
 "market_impact_bps": 8,
 "participation_rate": 0.2
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "adv": {
   "anyOf": [
    {
     "type": "number"
    },
    {
     "type": "null"
    }
   ],
   "title": "Adv",
   "description": "Average daily volume in USD (for Almgren model)"
  },
  "shares": {
   "type": "integer",
   "title": "Shares",
   "default": 1,
   "minimum": 1,
   "description": "Number of shares"
  },
  "spread_bps": {
   "type": "number",
   "title": "Spread Bps",
   "default": 5,
   "description": "Bid-ask spread in basis points"
  },
  "trade_value": {
   "type": "number",
   "title": "Trade Value",
   "description": "Total trade value in USD",
   "exclusiveMinimum": 0
  },
  "commission_pct": {
   "type": "number",
   "title": "Commission Pct",
   "default": 0,
   "description": "Commission as percentage of trade value"
  },
  "commission_flat": {
   "type": "number",
   "title": "Commission Flat",
   "default": 0,
   "description": "Flat commission per trade"
  },
  "market_impact_bps": {
   "type": "number",
   "title": "Market Impact Bps",
   "default": 0,
   "description": "Estimated market impact in basis points"
  },
  "participation_rate": {
   "type": "number",
   "title": "Participation Rate",
   "default": 0.1,
   "description": "Fraction of ADV consumed by trade"
  },
  "commission_per_share": {
   "type": "number",
   "title": "Commission Per Share",
   "default": 0,
   "description": "Commission per share"
  }
 }
}
```

## More

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