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 it is the figure to compare with a spending limit before signing. Signing and 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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"side": "<side>",
"asset": "<asset>",
"qty": "<qty>"
},
"name": "qmax_build_plan"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| qty | Yes | How many units of the asset | |
| side | Yes | Whether the order buys or sells the asset (a buy spends QU, a sell receives QU) | |
| asset | Yes | Asset symbol, for example CFB or QDOGE (case does not matter). qmax_list_assets lists the tradable symbols. | |
| holdings_qx | No | Selling only: units of this asset the wallet holds that QX manages | |
| slippage_bps | No | Slippage tolerance in basis points (100 = 1%), applied to the limits in each step | |
| holdings_qswap | No | Selling only: units of this asset the wallet holds that QSwap manages |