{"uid":"cap_vuXoHQP4dcRwILyVra6VZ","slug":"pre-trade-execution-gate-33c26c86","name":"Pre-Trade Execution Gate","description":"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.","url":"https://api.tradebot.devs.surf/v1/pre-trade-execution-gate?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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}}},"responseSchema":null,"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_gCgqJ0blgnydScsG6CB6K","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":"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.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Large BTC buy slippage check","prompt":"I have a live order book snapshot for BTC and I want to buy $100,000 worth — can you run an execution risk check and tell me if I'll get a PASS, CAUTION, or AVOID, and what the estimated slippage looks like?"},{"title":"Autonomous agent pre-trade gate","prompt":"Before my trading bot places a $15,000 sell order on SOL, check the order book I'm passing in and tell me if execution risk is acceptable — I need slippage, spread, depth utilization, and a go/no-go rating."},{"title":"Market impact assessment for LINK trade","prompt":"I'm about to place a $50,000 buy on LINK and I'm worried about market impact. Can you analyze this order book snapshot and tell me what fraction of visible liquidity I'd consume and what fill ratio to expect?"}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T06:33:00.346Z","isFirstParty":false,"canonicalSlug":"pre-trade-execution-gate-33c26c86"}