market_close_position
Close all open positions for a specified trading pair at the current market price. Automatically calculates the required side and size to exit the entire position.
Instructions
Close all positions for a coin at market price using HyperLiquid's market_close
Args: coin: Trading pair (e.g., "BTC", "ETH") client_order_id: Optional client order ID for tracking
Note: This closes ALL positions for the specified coin. HyperLiquid's market_close method automatically determines the correct side and size to close all positions.
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": {
"coin": "<coin>"
},
"name": "market_close_position"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coin | Yes | ||
| client_order_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||