Five MCP tools for GMX v2 perpetual trading
Call any of these tools via the MCP endpoint at https://vealth.net/mcp. Three tools are read-only. The two write tools split the trust correctly: prepare_gmx_order returns an unsigned transaction for you to sign with your own wallet, and submit_gmx_order relays the signed result. No private key ever touches us.
Five tools
// Read all open perpetual positions for a wallet on GMX v2 (Arbitrum). // Read-only, no signing needed, free. { "name": "gmx_get_positions", "description": "Read all open perpetual positions for a wallet on GMX v2 (Arbitrum). Read-only, no signing needed, free.", "inputSchema": { "type": "object", "properties": { "wallet": { "type": "string", "description": "0x... Arbitrum wallet address to check." } }, "required": ["wallet"] } }
// Read all pending orders (limit, stop-loss, etc.) for a wallet. // Read-only, no signing needed, free. { "name": "gmx_get_orders", "description": "Read all pending orders (limit, stop-loss, etc.) for a wallet on GMX v2 (Arbitrum). Read-only, no signing needed, free.", "inputSchema": { "type": "object", "properties": { "wallet": { "type": "string", "description": "0x... Arbitrum wallet address to check." } }, "required": ["wallet"] } }
// Fetch current mark prices for all tradeable assets on GMX v2 (Arbitrum). // Read-only, no signing needed, free. { "name": "gmx_get_prices", "description": "Fetch current mark prices for all tradeable assets on GMX v2 (Arbitrum). Read-only, no signing needed, free.", "inputSchema": { "type": "object", "properties": {}, "required": [] } }
// Build an unsigned on-chain transaction to open a new perpetual position. // 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. { "name": "prepare_gmx_order", "description": "Build 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).", "inputSchema": { "type": "object", "properties": { "wallet": { "type": "string", "description": "0x... Arbitrum wallet address (the order receiver, your wallet)." }, "asset": { "type": "string", "description": "Asset symbol (e.g. 'WIF', 'ETH', 'BTC', 'SOL')." }, "side": { "type": "string", "enum": ["long", "short"], "description": "Position direction." }, "collateralUsd": { "type": "number", "description": "Collateral amount in USD (must be > 0 and ≤ $5)." }, "leverage": { "type": "number", "description": "Leverage multiplier (1x to 10x)." }, "workPacketId": { "type": "string", "description": "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." } }, "required": ["wallet", "asset", "side", "collateralUsd", "leverage"] } }
// Relay a signed Ethereum transaction to the Arbitrum network. // The transaction must have been pre-signed by the caller using prepare_gmx_order. // This endpoint does NOT sign, it only broadcasts an already-signed transaction. { "name": "submit_gmx_order", "description": "Relay a signed Ethereum transaction to the Arbitrum network. The transaction must have been pre-signed by the caller using prepare_gmx_order output. This endpoint does NOT sign, it only broadcasts an already-signed transaction.", "inputSchema": { "type": "object", "properties": { "signedRawTransaction": { "type": "string", "description": "0x-prefixed raw signed transaction hex (e.g., from ethers.Wallet.signTransaction() or ethers.Signer.sendTransaction().wait())." } }, "required": ["signedRawTransaction"] } }
Example calls (JSON-RPC over POST)
Real example 1: Get current market prices (no arguments)
Real example 2: List positions for a wallet
Real example 3: Prepare an order (long ETH, $2 collateral, 3x leverage)
The non-custodial signing pattern
prepare_gmx_order, you get back a complete Ethereum transaction (not a message). You sign that transaction using your own wallet (ethers.Wallet, MetaMask, Ledger, or any other signer). Once signed, you hand us the signed raw transaction hex, and submit_gmx_order broadcasts it to Arbitrum on your behalf. We never ask for, receive, or store any private key material. If you revoke or lose the signing key, the transaction cannot be completed, so your funds stay safe.
Before your first order, you must approve the GMX Router to spend your USDC collateral. This is a separate approval transaction from your own wallet, required once per router, never again.
Why we built this
GMX's own documentation names an MCP server as "under development and not yet available." Agents need a working integration to be useful. We built directly against the documented v2 contracts on Arbitrum and put it live. The tools are read-only where they can be (fetching prices, orders, positions), and fully non-custodial for writes (prepare unsigned, you sign, we broadcast signed). Any agent that can call an MCP endpoint can now trade on GMX without vendor lock-in or custody risk.