pre_trade_check
One-call pre-trade sanity check: 'I want to long $X of SYMBOL — is now sane?' Combines live orderbook slippage at YOUR size, cross-exchange funding (carry cost), open-interest crowding, and contract security (GoPlus) into a single ok/caution/avoid verdict with a per-factor breakdown. Major ERC-20 addresses (LINK, UNI, ARB, OP, AAVE, PEPE, SHIB) resolve automatically; native assets (BTC, ETH, SOL, ...) report security n/a; an unrecognized token without token_address reads 'unknown' and caps the verdict at caution — an unscreened contract can never read 'ok'. Replaces four API integrations and the judgment layer on top of them. Raw component data embedded so you can apply your own thresholds.
Use when: An agent (or human) is about to enter a position and wants one verdict covering liquidity, carry, crowding, and security — instead of four raw feeds plus its own synthesis. Not for: you need a single raw factor — funding_rates, open_interest, orderbook_depth or token_security are free; you are not about to size a position. This call settles $0.01 on-chain. Returns: verdict (ok/caution/avoid), factors{liquidity,carry,crowding,security} each with level + reason, components{orderbook_depth,funding_rates,open_interest}, symbol, side, size_usd Example response: {"symbol":"ETH","side":"long","size_usd":50000,"verdict":"caution","factors":{"liquidity":{"level":"ok","slippage_pct":0.011,"bucket_usd":50000,"reason":"fills within 0.011% of best ask"},"carry":{"level":"caution","median_funding_pct":0.062,"annualized_pct":67.9,"reason":"longs paying elevated funding"},"crowding":{"level":"ok","long_short_ratio":1.4,"oi_change_24h_pct":3.2,"reason":"positioning unremarkable"},"security":{"level":"skipped","reason":"no token_address provided"}}}
Price: $0.01 USDC per call (x402 over MCP: an unpaid call returns PaymentRequired; pay via _meta x402/payment)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | No | Trade direction (funding carry is side-aware) | long |
| symbol | Yes | Asset to check, e.g. 'ETH', 'BTC', 'SOL' | |
| size_usd | No | Intended position size in USD (drives the slippage check) | |
| token_address | No | Optional ERC-20 contract address for the GoPlus security scan. Auto-resolved for major tokens; required for a full verdict on tokens the resolver doesn't know (otherwise security reads 'unknown' and caps the verdict at caution) |