gdex_preview_trade
Generate a trade preview without trading that turns an explicit trade intent into exact terms and returns a previewId for gdex_execute_trade; supports spot, perp open, and perp close.
Instructions
Turn an explicit trade intent into exact executable terms without trading: market, side, human and raw amounts, quote source and time, minimum received or limit price, funding plan, expiry (60s). Returns a previewId for gdex_execute_trade. kind=spot (USDC wallet), perp_open, perp_close. For perps give notionalUsd (position size) or marginUsd (collateral), never guess which.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dex | No | perp_close: builder DEX for a bare coin | |
| coin | No | perp: e.g. BTC, or xyz:TSLA for builder DEXes | |
| kind | Yes | ||
| side | No | spot: buy|sell; perp_open: long|short | |
| size | No | perp_close: contracts to close (omit = full) | |
| chain | No | spot: chain name or id | |
| amount | No | spot: USDC to spend (buy) or token amount (sell) | |
| slPrice | No | perp_open stop-loss | |
| tpPrice | No | perp_open take-profit | |
| leverage | No | perp_open: leverage (backend: cross on core perps, isolated on builder-DEX markets) | |
| marginUsd | No | perp_open: collateral in USD | |
| orderType | No | ||
| accountRef | Yes | From gdex_connect | |
| limitPrice | No | perp_open limit price | |
| autoFunding | No | spot buy: bridge USDC/gas from other chains (default true) | |
| notionalUsd | No | perp_open: position size in USD | |
| slippagePct | No | spot: max slippage %, default 1, max 5 | |
| tokenAddress | No | spot: token contract / mint |