close_gmx_position
Close or reduce a perpetual position on GMX V2 (Arbitrum) using a MarketDecrease order. Specify market, collateral, size, acceptable price, and direction.
Instructions
Closes (fully or partially) a perpetual position on GMX V2 (Arbitrum). Creates a MarketDecrease order. Specify the market, collateral token, size to close, and direction. Use the full position size in size_delta_usd for a complete close.
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": {
"market": "<market>",
"collateral_token": "<collateral_token>",
"size_delta_usd": "<size_delta_usd>",
"acceptable_price": "<acceptable_price>",
"is_long": "<is_long>"
},
"name": "close_gmx_position"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| market | Yes | Market label (e.g. "ETH/USD") or market token address. | |
| is_long | Yes | true if closing a long position, false for short. | |
| chain_id | No | Chain ID. Default: 42161 (Arbitrum One). | |
| size_delta_usd | Yes | Size to close in USD with 30 decimals. Use full position size for complete close. | |
| acceptable_price | Yes | Min acceptable price for longs, max for shorts (30 decimals). Set with a buffer to avoid keeper rejection. | |
| collateral_token | Yes | Collateral token of the existing position. |