factor_hl_compile_close
Compile a BatchPlan to close a HyperLiquid perp position without broadcasting it, returning ordered EVM and HL operations, warnings, blockers, and notional estimates for HyperEVM execution.
Instructions
Compile (do NOT broadcast) a BatchPlan for closing a HyperLiquid perp position. If sizeUsd is omitted, defaults to a full close. Returns ordered EVM + HL Exchange ops, structured warnings / blockers, and notional estimates. Use factor_hl_close_position to actually execute. HyperEVM (chain 999) only.
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": {
"vault": "<vault>",
"instrumentId": "<instrumentId>"
},
"name": "factor_hl_compile_close"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vault | Yes | Vault contract address (HyperEVM). | |
| sizeUsd | No | Notional size in USD to close. Omit for a full close (uses current position notional). | |
| instrumentId | Yes | Catalog id ("perp:main:BTC", "perp:xyz:BRENTOIL"), qualifiedSymbol, or bare ticker. |