hl_close_outcome_order
Exit a HIP-4 outcome position by selling held side tokens. Specify outcome, side, and limit or market order for full or partial exits.
Instructions
Exit a HIP-4 outcome position by SELLING held side tokens (the backend always sells; it cannot short). Structured mode: apiKey, walletAddress (control), sessionPrivateKey, outcomeId, one of coin/sideIndex/sideLabel, price (limit) or isMarket=true, optional size (whole contracts; omit for a full exit — the backend caps size to what you hold). With managedAddress, partial exits must leave both the sold part and the remainder >= 11 quote. Settled markets have no book: GDEX has no claim endpoint, check the HL spot balance instead. Pre-built mode: computedData alone.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coin | No | Side coin "#<assetId>" from hl_outcomes sides[].coin. Give exactly one of coin / sideIndex / sideLabel. | |
| size | No | Contracts to sell; omit for the full position | |
| price | No | Limit price (omit for isMarket) | |
| apiKey | No | Structured mode: API key | |
| isMarket | No | ||
| outcomeId | No | ||
| sideIndex | No | Side index in sides[] (sides are NOT always Yes/No; read the labels) | |
| sideLabel | No | Exact side label from sides[].label, e.g. "No" or a team name | |
| accountRef | No | Connected account from gdex_connect. Supplies session key, wallet address, API key and session data so no secret is passed in chat | |
| computedData | No | Pre-built mode ONLY: encrypted payload. Must be sent alone (no structured fields). | |
| walletAddress | No | Structured mode: CONTROL wallet address from sign-in (not the managed address) | |
| managedAddress | No | Managed wallet; enables position-aware partial-exit checks | |
| sessionPrivateKey | No | Structured mode: session private key |