gdex_manage_position
Preview closing or reducing a perpetual position, or selling a spot token back to USDC, against live state before executing the trade.
Instructions
Preview an exit for an existing position, against its live state: close/reduce a perp (reduce-only, correct side for longs and shorts) or sell a spot token back to USDC. Returns a preview; execute it with gdex_execute_trade.
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": {
"accountRef": "<accountRef>",
"action": "<action>"
},
"name": "gdex_manage_position"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dex | No | ||
| coin | No | perp coin for close/reduce | |
| size | No | reduce: contracts to close | |
| chain | No | sell: chain | |
| action | Yes | ||
| amount | No | sell: token amount, or "all", "half", "25%" of the actual holding | |
| accountRef | Yes | ||
| slippagePct | No | ||
| tokenAddress | No | sell: token |