Prepare a GMX market-order transaction (non-custodial)
prepare_gmx_orderBuild an unsigned on-chain transaction to open a new perpetual position on GMX v2 (Arbitrum). Returns transaction fields ready for the caller to sign with their own wallet. This is NOT a message to sign — it is a full Ethereum transaction. Requires the caller to have approved the GMX Router for USDC collateral spending (a separate one-time approve() call).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | Position direction. | |
| asset | Yes | Asset symbol (e.g. 'WIF', 'ETH', 'BTC', 'SOL'). | |
| wallet | Yes | 0x… Arbitrum wallet address (the order receiver — your wallet). | |
| leverage | Yes | Leverage multiplier (1x to 10x). | |
| workPacketId | No | Optional. A vealth.net EWP work packet id (from find_work) to pledge this trade's UI fee toward. Moves no money now — records intent only. Funding still requires a separate, later, confirmed payment, exactly like any other funder. | |
| collateralUsd | Yes | Collateral amount in USD (must be > 0 and ≤ $5). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| tool | No | ||
| funded | No | ||
| payUsd | No | ||
| workId | No | ||
| claimId | No | ||
| claimable | No | ||
| next_call | No | ||
| proofRule | No | ||
| fulfillableBy | No | ||
| definitionOfDone | No | ||
| needs_from_caller | No | ||
| notClaimableReason | No |