{"uid":"cap_cpqCW11za1FIzkHxzuGcR","slug":"oracleinsight-pre-trade-safety-check-31dd642f","name":"OracleInsight Pre-Trade Safety Check","description":"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.","url":"https://www.oracleinsight.xyz/api/v1/safety/pre-trade?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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"}}}}},"responseSchema":{"type":"json","example":{"verdict":"PASS","staleDataRisk":false,"consensusPrice":3124.5,"maxDeviationPct":0.42,"participantCount":5,"manipulationRiskScore":0.08,"crossProviderAgreement":0.998,"recommendedMaxPositionUsd":95000}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_UAI-VobmoNKw1CAaBDqcL","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Assesses oracle transparency and manipulation risk for a DeFi trade before execution, returning consensus price, deviation, staleness, and a recommended max position size.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Pre-swap oracle risk check","prompt":"I'm about to swap $50,000 worth of ETH on Ethereum mainnet — can you check the oracle safety first and tell me the consensus price, any deviation between providers, and whether there's a manipulation risk before I proceed?"},{"title":"Pre-borrow protocol oracle validation","prompt":"I want to borrow $100,000 on Aave v3 Ethereum using USDC — can you run a pre-trade oracle check against aave-v3-ethereum and tell me if the data is fresh and safe, and what the recommended max position is?"},{"title":"Liquidation oracle sanity check","prompt":"Before I trigger a liquidation on Ethereum for BTC worth about $200,000, check the oracle consensus price and manipulation risk score across all available providers — I need to make sure the price data is reliable and not stale."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-13T06:34:41.938Z","isFirstParty":false,"canonicalSlug":"oracleinsight-pre-trade-safety-check-31dd642f"}