Preview a perpetual futures order
preview_orderCheck a perpetual futures order and its stop-loss against the permissions, limits and price band, sending nothing. Use before every new position. Not for closing (use close_position). Every order: symbol, side, size_base (from size_position) and a stop. Entry styles add: market, nothing; limit, order_type "limit" and price; at a price, trigger_price; ladder, order_type "limit" and ladder_prices. A market entry may carry worst_price, and then valid_seconds up to 120. Returns preview_id (valid 30 s unless longer) and every check. Next: execute_previewed_order(preview_id).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | buy = open or add to a long, sell = open or add to a short | |
| price | No | Limit price, USD per coin (limit orders only) | |
| venue | No | Venue: sandbox, hyperliquid, okx, bybit or binance. Omitted: the agent's only venue, else hyperliquid if connected, else your only connected exchange, else the sandbox; or "best": the cheapest all-in venue (price plus fee) you may use and have the margin for | |
| reason | No | Optional: why, in your words (up to 500 characters). The person sees it on the approval card and in history; other agents never do | |
| symbol | Yes | Base coin, e.g. BTC | |
| leverage | No | Leverage, e.g. 5 (the default); size_position's preview_args carries one your limits allow | |
| oco_with | No | Optional, for an entry that waits (trigger_price or a limit order): the request_id (req_…) of another waiting entry of yours, a trigger entry or an unfilled limit order, on any symbol or venue. One cancels the other: once either opens, the rest of the group is withdrawn (e.g. a buy above resistance or a sell below support) | |
| size_base | Yes | Size in the base coin (BTC, not USD); rounded down to the venue step. Get it from size_position | |
| stop_loss | No | Required stop-loss, USD per coin: below entry for buys, above for sells. Or give stop_distance_pct | |
| hold_hours | No | Optional: how long you expect to hold, in hours, to see funding and the round trip's cost (and, with venue "best", to choose by them) | |
| order_type | No | market | |
| take_profit | No | Optional take-profit, USD per coin | |
| worst_price | No | Optional, market entries: the worst price it may fill at, USD per coin (above the mark for buys, below for sells). Execution is refused once the mark is past it, and never fills beyond it | |
| ladder_prices | No | Optional ladder entry: 2-5 limit prices, size_base split evenly across them, one stop-loss beyond all of them (stop_distance_pct counts from the farthest price); order_type limit, no price | |
| trigger_price | No | Optional: hold the order and open it at market only when the mark reaches this price (a breakout or a pullback), re-checked then; market orders only. Risk is computed from this price | |
| valid_seconds | No | How long the preview stays valid: 30 (the default), or up to 120 with worst_price, for a person or a slow model to decide | |
| stop_distance_pct | No | Or the stop as a distance from the entry (trigger price, limit price or mark), 0.02 = 2% | |
| trigger_valid_hours | No | With trigger_price: hours it waits before lapsing, 1-168 (default 24) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | True: every check passed | |
| legs | No | A ladder entry: [{price, size_base}] per limit leg, USD per coin and in the base coin (e.g. BTC), not USD | |
| side | Yes | buy or sell | |
| venue | Yes | Venue name | |
| checks | Yes | Every check that ran, all pass | |
| symbol | Yes | Base coin | |
| risk_usd | Yes | Loss if the stop fills, USD | |
| size_base | Yes | Size after rounding down to the venue step, in the base coin (e.g. BTC), not USD (the same name as the input) | |
| expires_at | Yes | ISO 8601 UTC | |
| fee_source | No | account (your own rate), published (the base rate) or none (sandbox) | |
| margin_usd | Yes | Margin needed, USD | |
| mark_price | Yes | Mark at preview time, USD per coin | |
| preview_id | Yes | Pass to execute_previewed_order before expires_at | |
| deprecation | No | Present only while this tool is deprecated: replacement, removal_date, changelog | |
| est_fee_usd | No | Trading fee for this order, USD: taker rate for market orders, maker for limit; the exit pays a fee too | |
| worst_price | No | With worst_price: the bound, USD per coin; it never fills beyond it | |
| fee_rate_bps | No | The rate used, basis points of notional | |
| notional_usd | Yes | size_base x entry, USD | |
| venue_choice | No | With venue "best": why this venue (all-in price and the alternatives) | |
| trigger_price | No | A trigger entry: opens at market only when the mark reaches this, USD per coin | |
| est_fill_price | No | Market orders: average fill if executed now against the book, USD per coin; null for limit orders or when the book is too thin to say | |
| est_funding_usd | No | With hold_hours: funding over that time at today's rate, USD; negative = received | |
| est_slippage_bps | No | est_fill_price against mark_price in basis points, positive = worse; a market order never fills beyond the price band | |
| requires_approval | Yes | True: execute_previewed_order will wait for a person's approval | |
| trigger_valid_hours | No | A trigger entry: hours it waits before lapsing | |
| est_round_trip_cost_usd | No | With hold_hours: entry fee, exit fee at the taker rate and that funding, USD |