{"uid":"cap_OkLqqe_CE5h0Y5aioNCRm","slug":"butterfly-delta-order-preflight-a027d635","name":"Butterfly Delta Order Preflight","description":"A $0.01 exact-order preflight for crypto trading bots: live Coinbase and Gemini depth, estimated slippage, spread, freshness, and venue integrity before every order.","url":"https://butterflydelta.com/api/agent/order-preflight?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"trade":{"type":"object","required":["pair"],"properties":{"pair":{"type":"string","pattern":"^[A-Za-z0-9]{2,15}[-/_]USD$","description":"USD spot pair, for example BTC-USD."},"side":{"enum":["buy","sell"],"type":"string"},"venue":{"enum":["coinbase","gemini"],"type":"string","description":"Optional execution venue. Include with side and baseSize for exact-order simulation."},"summary":{"type":"string","maxLength":1000},"baseSize":{"type":"number","description":"Exact base-asset size, for example 0.25 BTC.","exclusiveMinimum":0},"deadline":{"type":"string","maxLength":120},"orderType":{"enum":["market","limit"],"type":"string","default":"market"},"limitPrice":{"type":"number","description":"Required when orderType is limit.","exclusiveMinimum":0},"minHealthyVenues":{"type":"number","default":2,"maximum":2,"minimum":1},"maxVenueSpreadBps":{"type":"number","default":10,"maximum":10000,"minimum":0},"maxQuoteAgeSeconds":{"type":"number","default":10,"maximum":3600,"minimum":0},"minDepthCoveragePct":{"type":"number","default":100,"maximum":100,"minimum":0},"maxEstimatedSlippageBps":{"type":"number","default":25,"maximum":10000,"minimum":0},"maxCrossVenueDivergenceBps":{"type":"number","default":20,"maximum":10000,"minimum":0}},"description":"Bot-native input. Butterfly Delta expands this policy into explicit, signed venue assertions.","additionalProperties":false},"action":{"type":"object","required":["kind","target"],"properties":{"kind":{"enum":["trade","purchase","transfer","deploy","publish","api_call","execute","other"],"type":"string"},"stakes":{"type":"object","properties":{"value":{"type":"string","maxLength":80},"currency":{"type":"string","maxLength":32},"irreversible":{"type":"boolean"}},"additionalProperties":false},"target":{"type":"string","maxLength":240,"minLength":2},"summary":{"type":"string","maxLength":1000},"deadline":{"type":"string","maxLength":120},"execution":{"type":"object","required":["venue","side","baseSize"],"properties":{"side":{"enum":["buy","sell"],"type":"string"},"venue":{"enum":["coinbase","gemini"],"type":"string"},"baseSize":{"type":"number","exclusiveMinimum":0},"orderType":{"enum":["market","limit"],"type":"string","default":"market"},"limitPrice":{"type":"number","exclusiveMinimum":0},"minDepthCoveragePct":{"type":"number","default":100,"maximum":100,"minimum":0},"maxEstimatedSlippageBps":{"type":"number","default":25,"maximum":10000,"minimum":0}},"description":"Exact intended order used to simulate visible depth and estimated slippage on the selected venue.","additionalProperties":false},"jurisdiction":{"type":"string","maxLength":120}},"additionalProperties":false},"intent":{"type":"object","required":["kind","instrument"],"deprecated":true,"properties":{"kind":{"enum":["trade","allocation","transfer","other"],"type":"string"},"side":{"type":"string","maxLength":32},"venue":{"type":"string","maxLength":120},"horizon":{"type":"string","maxLength":120},"summary":{"type":"string","maxLength":1000},"instrument":{"type":"string","maxLength":120,"minLength":2}},"description":"Compatibility input for butterflydelta-gate/0.x. Use action instead.","additionalProperties":false},"checkpoint":{"type":"string","maxLength":160},"assumptions":{"type":"array","items":{"type":"object","required":["statement"],"properties":{"id":{"type":"string","maxLength":64},"assertion":{"type":"object","required":["metric","operator","value"],"properties":{"unit":{"type":"string","maxLength":32},"value":{"type":["string","number","boolean"]},"metric":{"enum":["market.coinbase.accepting_orders","market.coinbase.spread_bps","market.coinbase.last_trade_age_seconds","market.gemini.accepting_orders","market.gemini.spread_bps","market.coinbase.estimated_slippage_bps","market.coinbase.depth_coverage_pct","market.gemini.estimated_slippage_bps","market.gemini.depth_coverage_pct","market.cross_venue_mid_deviation_bps","market.source_count"],"type":"string"},"operator":{"enum":["lt","lte","eq","neq","gte","gt"],"type":"string"}},"additionalProperties":false},"statement":{"type":"string","maxLength":1000,"minLength":8}},"additionalProperties":false},"maxItems":20,"minItems":1}}},"responseSchema":{"type":"json","example":{"verdict":"NO_MATCH_IN_CURRENT_COVERAGE","coverage":{"status":"PARTIAL","matchedModules":[{"id":"crypto.execution_integrity"},{"id":"us.crypto_regulation"}]},"protocol":"butterflydelta-preflight/1.0","capability":"delta_preflight","attestation":{"payload":{"scheme":"eip191","expiresAt":"..."},"signature":"0x..."},"executionGate":{"state":"PASS","machineAction":"PROCEED_UNDER_CALLER_POLICY","allRequiredAssertionsHold":true},"assumptionResults":[{"id":"venue","state":"HOLDS","observed":true}]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Lrrxxjzzrbnm5ssULcj4W","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Runs a $0.01 pre-trade integrity check on a crypto order by fetching live Coinbase and Gemini order book depth, estimating slippage and spread, and returning a signed PASS/FAIL verdict before execution.","exampleAgentPrompt":"Before my bot submits that 0.25 BTC market buy on Coinbase, run a Butterfly Delta preflight on BTC-USD — check that slippage stays under 25 bps, spread under 10 bps, and quotes are fresh within 10 seconds.","exampleUseCases":[{"title":"Bot safeguard before large market order","prompt":"My trading bot is about to place a 2.0 ETH market sell on Coinbase — run a Butterfly Delta preflight on ETH-USD to make sure slippage won't exceed 30 bps and the order book has enough depth to cover the full size before it fires."},{"title":"Cross-venue spread sanity check","prompt":"Before I route my SOL-USD buy, run a preflight across both Coinbase and Gemini and tell me whether the spread is under 10 bps and whether the venues are diverging by more than 20 bps — I need a signed verdict I can log."},{"title":"Limit order integrity check before submission","prompt":"I'm about to submit a limit buy for 1.5 BTC at $62,500 on Gemini — can you run a Butterfly Delta order preflight on BTC-USD to confirm the book is healthy, quotes are under 10 seconds old, and I should proceed?"}],"resultDescription":"Returns a JSON object containing an executionGate with a PASS or FAIL state and a machineAction directive (e.g. PROCEED_UNDER_CALLER_POLICY), a list of assumption results (venue health, spread, slippage, depth coverage, quote freshness), a coverage status indicating which integrity modules were checked, and a signed EIP-191 attestation with an expiry timestamp — giving the calling agent a verifiable, machine-readable record of pre-trade conditions.","failureModes":["Stale quotes: if order book data exceeds maxQuoteAgeSeconds, the freshness assertion fails and the gate returns FAIL","Thin order book: insufficient depth to cover baseSize triggers minDepthCoveragePct failure","Spread too wide: spread exceeding maxVenueSpreadBps causes a venue integrity assertion failure","Cross-venue divergence: if Coinbase and Gemini mid-prices diverge beyond maxCrossVenueDivergenceBps, gate fails","Slippage exceeded: estimated slippage above maxEstimatedSlippageBps returns a FAIL verdict","Unsupported pair: trading pair not found in Coinbase or Gemini coverage returns NO_MATCH_IN_CURRENT_COVERAGE verdict","Payment failure: missing or invalid x402 USDC payment header results in 402 rejection before preflight runs","Invalid pair format: pair string not matching the required pattern returns a schema validation error"],"whenToPreferThis":"Choose this endpoint when an autonomous crypto trading agent needs a signed, machine-readable pre-trade integrity gate before committing a real order — especially when slippage, spread, order book depth, quote freshness, or cross-venue divergence are failure conditions that must be verified and logged. It is ideal for bots trading on Coinbase or Gemini where explainability and auditability of pre-trade conditions matter, or when a downstream compliance layer requires a signed attestation. Prefer it over generic market-data APIs when you need an actionable PASS/FAIL verdict with explicit assumption assertions rather than raw quote data.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-10T06:36:45.096Z","isFirstParty":false,"canonicalSlug":"butterfly-delta-order-preflight-a027d635"}