# Pre-Trade Execution Gate

> Pre-Trade Execution Gate is a paid API for AI agents from api.tradebot.devs.surf, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-30).

Evaluates execution risk for a crypto trade by analyzing an order book snapshot, returning PASS/CAUTION/AVOID with estimated slippage, spread, fill ratio, and liquidity depth metrics.

## Facts

- Endpoint: POST https://api.tradebot.devs.surf/v1/pre-trade-execution-gate?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pre-trade-execution-gate-33c26c86
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vuXoHQP4dcRwILyVra6VZ

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 pre-trade-execution-gate-33c26c86 -d '<json body>'
```

Example prompt: Before I place a $25,000 buy order for ETH, run a pre-trade execution check on the current order book snapshot I have — give me the slippage estimate, fill ratio, and whether I should proceed, hold, or avoid.

## When to prefer this

Choose this endpoint when an autonomous trading agent needs a fast, read-only liquidity and execution-risk check before submitting a real order, especially for larger notional sizes where slippage and market impact matter. It is preferable over generic market data APIs because it returns actionable risk ratings (PASS/CAUTION/AVOID) rather than raw data, and it specifically models fill ratio and depth utilization relative to the trade size. Use it as a pre-trade gate in automated pipelines to avoid bad fills without ever touching exchange accounts.

## Known failure modes

- Order book has fewer than 25 bid or ask levels — request rejected with validation error
- notional_usd outside $10–$1,000,000 range — validation error
- Unsupported asset symbol — enum validation error
- caller_authorized_use not set to true — authorization error
- Stale or malformed date-time in provenance — format validation error
- Missing required book fields (symbol, bids, asks) — schema validation error

## How this service works

Check execution risk before placing a crypto trade. Submit a visible order book, trade side and notional; receive PASS, CAUTION or AVOID with estimated slippage, spread, fill ratio, visible liquidity and depth utilization. Built for autonomous trading agents that need a fast pre-trade liquidity and execution-risk check. Read-only: never places orders, accesses exchange accounts or gives investment advice.

## Output

Returns a risk rating (PASS, CAUTION, or AVOID) along with quantitative metrics: estimated slippage percentage, bid-ask spread, expected fill ratio, total visible liquidity, and depth utilization — all derived from the submitted order book snapshot and notional trade size.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "book": {
   "type": "object",
   "title": "ExecutionBook",
   "required": [
    "symbol",
    "bids",
    "asks"
   ],
   "properties": {
    "asks": {
     "type": "array",
     "items": {
      "type": "array",
      "items": {
       "type": "number"
      },
      "minItems": 2,
      "prefixItems": [
       {
        "type": "number",
        "exclusiveMinimum": 0
       },
       {
        "type": "number",
        "exclusiveMinimum": 0
       }
      ]
     },
     "title": "Asks",
     "minItems": 25
    },
    "bids": {
     "type": "array",
     "items": {
      "type": "array",
      "items": {
       "type": "number"
      },
      "minItems": 2,
      "prefixItems": [
       {
        "type": "number",
        "exclusiveMinimum": 0
       },
       {
        "type": "number",
        "exclusiveMinimum": 0
       }
      ]
     },
     "title": "Bids",
     "minItems": 25
    },
    "symbol": {
     "type": "string",
     "title": "Symbol"
    }
   },
   "additionalProperties": false
  },
  "side": {
   "enum": [
    "buy",
    "sell"
   ],
   "type": "string",
   "title": "Side"
  },
  "asset": {
   "enum": [
    "BTC",
    "ETH",
    "BNB",
    "SOL",
    "XRP",
    "DOGE",
    "ADA",
    "LINK"
   ],
   "type": "string",
   "title": "Asset"
  },
  "provenance": {
   "type": "object",
   "title": "ExecutionProvenance",
   "required": [
    "source_label",
    "latest_data_at",
    "caller_authorized_use"
   ],
   "properties": {
    "source_label": {
     "type": "string",
     "title": "Source Label",
     "pattern": "^[^\\x00-\\x1F]*[^\\s\\x00-\\x1F][^\\x00-\\x1F]*$",
     "maxLength": 120,
     "minLength": 1
    },
    "latest_data_at": {
     "type": "string",
     "title": "Latest Data At",
     "format": "date-time",
     "pattern": "Z$"
    },
    "caller_authorized_use": {
     "type": "boolean",
     "const": true,
     "title": "Caller Authorized Use"
    }
   },
   "additionalProperties": false
  },
  "caller_data": {
   "type": "boolean",
   "const": true,
   "title": "Caller Data"
  },
  "notional_usd": {
   "type": "number",
   "title": "Notional Usd",
   "maximum": 1000000,
   "minimum": 10
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pre-trade-execution-gate-33c26c86/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.tradebot.devs.surf](https://www.zero.xyz/host/api.tradebot.devs.surf/llms.txt)
