Build the unsigned transactions for a trade
qmax_build_planQuotes an order and returns the exact transactions a wallet must sign to carry it out, in order. QMax signs nothing and sends nothing: you (or the user) sign each step with your own wallet and broadcast it.
Steps (in order): any share-management move needed first (selling shares that the other market manages), then one call per market. Each step: kind, description, destination (a smart contract by index), inputType (procedure number), amountQu to attach (QU that may leave the wallet; unused QU is refunded by the contracts) and payloadBase64 (the call's input bytes). 'maxOutlayQu' is the most QU that can leave the wallet across all steps, so check it against your own spending limit BEFORE signing. Sending a step moves real funds.
For a sell, pass how many shares the wallet holds under QX management and under QSwap management (holdings_qx, holdings_qswap) so the right moves are planned. Buys need no holdings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| qty | Yes | ||
| side | Yes | ||
| asset | Yes | Asset symbol, for example CFB or QDOGE (case does not matter). Use qmax_list_assets to find one. | |
| holdings_qx | No | Selling only: units of this asset the wallet holds that QX manages | |
| slippage_bps | No | ||
| holdings_qswap | No | Selling only: units of this asset the wallet holds that QSwap manages |