# OracleInsight Pre-Trade Safety Check

> OracleInsight Pre-Trade Safety Check is a paid API for AI agents from www.oracleinsight.xyz, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-13).

Assesses oracle transparency and manipulation risk for a DeFi trade before execution, returning consensus price, deviation, staleness, and a recommended max position size.

## Facts

- Endpoint: GET https://www.oracleinsight.xyz/api/v1/safety/pre-trade?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/oracleinsight-pre-trade-safety-check-31dd642f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cpqCW11za1FIzkHxzuGcR

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 oracleinsight-pre-trade-safety-check-31dd642f
```

Example prompt: Before I swap $75,000 of ETH on Ethereum (chain ID 1), run an oracle safety check — I want to know if the price data is fresh, how much deviation there is across providers, and whether there's any manipulation risk.

## When to prefer this

Use this endpoint when you need a structured, signed pre-trade oracle safety assessment for a specific DeFi action — especially for large trades where manipulation or stale data could cause significant loss. It is preferable over generic price feeds when you need multi-source deviation analysis, independence checks, manipulation risk scoring, and a recommended position ceiling rather than just a raw price. Best suited for agents automating DeFi interactions on Ethereum and other EVM chains where oracle integrity is critical.

## Known failure modes

- Unsupported asset symbol returns an error or empty oracle data
- Unknown or unsupported chainId results in no oracle participants found
- Trade amount of zero or negative may trigger validation errors
- Invalid action enum value returns a 400-level error
- No oracle providers available for the requested asset/chain combination returns low participant count or error
- Rate limiting or payment failure (402) if USDC payment is not attached
- protocolId not found may result in partial or missing protocol-specific fields

## How this service works

Pre-trade safety check: oracle-immune-system verdict for one trade, with verifiable EIP-712 attestation support. BLOCK verdicts are complete checks and are charged.

## Output

A JSON object containing a PASS/FAIL verdict, boolean stale data risk flag, consensus price across oracle providers, maximum deviation percentage between sources, number of participating oracles, a manipulation risk score (0–1), cross-provider agreement ratio, and a recommended maximum position size in USD given current oracle health.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "asset",
      "chainId",
      "action",
      "tradeAmountUsd"
     ],
     "properties": {
      "asset": {
       "type": "string",
       "description": "Asset symbol, e.g. ETH, BTC, USDC"
      },
      "action": {
       "enum": [
        "swap",
        "borrow",
        "lend",
        "liquidate",
        "repay"
       ],
       "type": "string",
       "description": "Type of DeFi operation"
      },
      "chainId": {
       "type": "number",
       "description": "Chain ID, e.g. 1=Ethereum, 0=chain-agnostic"
      },
      "protocolId": {
       "type": "string",
       "description": "Optional lending protocol id to evaluate against (e.g. aave-v3-ethereum)"
      },
      "schemaVersion": {
       "enum": [
        1,
        2,
        3
       ],
       "type": "number",
       "description": "Attestation schema version: 1 (default, 11-field), 2 (26-field, CAIP-19 + quorum gate), or 3 (27-field: v2 + the signed independence threshold, so the gate is self-verifying)"
      },
      "tradeAmountUsd": {
       "type": "number",
       "description": "Trade size in USD"
      },
      "targetProviders": {
       "type": "string",
       "description": "Comma-separated list of oracle providers to restrict the check to"
      },
      "destinationAsset": {
       "type": "string",
       "description": "Optional destination asset symbol (v2 binds it as destinationAssetId)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "verdict": "PASS",
  "staleDataRisk": false,
  "consensusPrice": 3124.5,
  "maxDeviationPct": 0.42,
  "participantCount": 5,
  "manipulationRiskScore": 0.08,
  "crossProviderAgreement": 0.998,
  "recommendedMaxPositionUsd": 95000
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/oracleinsight-pre-trade-safety-check-31dd642f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.oracleinsight.xyz](https://www.zero.xyz/host/www.oracleinsight.xyz/llms.txt)
