Prepare a signable trade intent for the agent wallet
problee_prepare_tradePrepare a signable trade intent for the agent wallet. There is no transaction to broadcast: sign the returned signPayload.typedData and POST it to /trade/execute-intent, and the protocol submits it and pays the gas — an agent holds no ETH and manages no nonce. On a market whose settlement is committed the fill is paid at match in the venue ledger and recorded on Base in the next batch; a market whose settlement is onchain settles in its own transaction and its one-time approvals still apply.
Examples: Prepare a signable buy intent
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | `side` = which OUTCOME (0-indexed: 0=outcome1,1=outcome2,2=outcome3), NOT buy/sell. Buy/sell is the direction field (`type`/`tradeType`/`action`/`direction`). | |
| amount | No | Exact-input size. BUY: collateral spent. SELL: outcome tokens sold. Outcome tokens carry the market collateral's own denomination — one outcome token redeems for one collateral unit — so every outcome-token quantity uses that single unit: positions.outcome1Shares/outcome2Shares/outcome3Shares, SELL amount, 409 available/requested, and outcomeTokensOut/minOutcomeTokensOut. It is also the unit the signed intent carries, so nothing is converted between the wire, the engine and the calldata. Omit when using closePercent or targetCollateralOut. | |
| chainId | No | ||
| tradeType | Yes | Trade DIRECTION (buy/sell). Note: this same concept is named `kind` (0=buy/1=sell int) on /orderbook/* and `side`/`action`/`tradeType`/`type`/`direction` on other trade endpoints — see skill.md field-map. | |
| proofNonce | No | Required single-use nonce for the wallet proof. Fetch from POST /api/auth/nonce; consumed on verification so the proof cannot be replayed. | |
| slippageBps | No | ||
| closePercent | No | SELL only. Percent (1–100) of the wallet’s current position in `side` to sell; 100 closes it fully. Server sizes from the live on-chain balance. Mutually exclusive with amount and targetCollateralOut. | |
| marketAddress | Yes | ||
| walletAddress | Yes | Wallet that will sign/broadcast the trade | |
| idempotencyKey | Yes | Required write-safety key; reuse it unchanged when retrying this preparation | |
| walletSignature | No | Action-bound wallet proof. Sign the canonical 'problee-mcp-auth:…' challenge (binds agent, apiKey, tool, scope, chain, resource, payloadHash, nonce, timestamp). | |
| signatureTimestamp | No | Unix timestamp (seconds) used in the signed challenge message | |
| targetCollateralOut | No | SELL only. Size the sell so its net proceeds reach ~this much collateral (wei); server sizes from the live balance. Mutually exclusive with amount and closePercent. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |