pre_trade_safety_check
Pre-trade decision-input integrity checkpoint for AI agents. Call this BEFORE executing any on-chain swap/borrow/lend/liquidation/repay to verify that the price the action relies on can be trusted. First assessment domain: oracle risk — aggregates cross-oracle consensus prices, per-provider deviation, data freshness, stablecoin peg status, and reputation into a single verdict. An optional decisionInput object adds a separate Chainlink/CEX/DEX input-sufficiency assessment against the caller-supplied venue quote and explicit limits, with an independently verifiable EIP-712 signature when signing is enabled; it never changes the verdict. Verdicts are PASS / CAUTION / DANGER / BLOCK. AI agents MUST NOT execute trades when the verdict is DANGER or BLOCK. Also returns a recommended maximum position size. A PASS is not principal authorization or a guarantee of price correctness or economic safety.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| asset | Yes | Asset symbol being traded, e.g. BTC, ETH, USDC | |
| action | Yes | ||
| chainId | Yes | Chain ID where the trade executes, e.g. 1=Ethereum, 42161=Arbitrum, 8453=Base. Use 0 for chain-agnostic. | |
| tradeAmountUsd | Yes | Trade size in USD | |
| targetProviders | No | Optional: restrict the check to specific oracle providers |