close_position
Close open positions on HyperLiquid by specifying a coin and percentage. Handles both full and partial closure using market or limit orders.
Instructions
Close a position (full or partial)
Args: coin: Trading pair (e.g., "BTC", "ETH") percentage: Percentage of position to close (default: 100.0 for full close)
Note: For 100% closure, uses market_close_position for optimal execution. For partial closure, you'll need to use limit orders as HyperLiquid's market_close closes 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": "close_position"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coin | Yes | ||
| percentage | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||