{"slug":"x402-ottoai-services-close-position-365270","title":"Close an open perpetual position on Hyperliquid (full or partial)","host":"x402.ottoai.services","method":"POST","resource":"https://x402.ottoai.services/close-position","category":"other","description":"Close an open perpetual position on Hyperliquid (full or partial). Cancels all attached TP/SL trigger orders automatically.","price_listed":0.01,"price_asked":0.01,"state":"answering","state_label":"Answering","checks_7d":1,"answered_7d":1,"latency_ms_median":938,"reported_calls_30d":2,"reported_payers_30d":1,"networks":["eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"asset":"BTC","partialClosePercentage":100},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"additionalProperties":false,"properties":{"asset":{"description":"Asset ticker of the open position","type":"string"},"closePercent":{"description":"Alias for partialClosePercentage. Accepted; sending both with different values is rejected.","type":"number"},"partialClosePercentage":{"description":"Percentage of the position to close (1-100). 100 closes it fully. Required — an omitted percentage is rejected, never treated as a full close.","type":"number"}},"required":["asset","partialClosePercentage"],"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"properties":{"action_required":{"description":"Present on the non-success outcomes: this position needs you to look at it.","type":"boolean"},"amountConfirmed":{"description":"Did the venue state HOW MUCH closed? When false the close is confirmed and its size is not, so closedPercentage, closedSize, closedSizeActual and realizedPnl are ALL ABSENT — there is no amount to publish and the request's own figures are not a stand-in. Read requestedPercentage/requestedSize for what was asked, and check the position on Hyperliquid for what remains.","type":"boolean"},"as_of":{"description":"ISO-8601 time the reported venue state was read.","type":"string"},"asset":{"type":"string"},"close":{"description":"Present on the non-success outcomes: the close as it was submitted, so you can check it without a second call.","properties":{"accepted":{"description":"Present and false when the venue explicitly refused the close.","type":"boolean"},"asset":{"type":"string"},"requestedPercentage":{"type":"number"},"side":{"type":"string"},"sizeRequested":{"description":"Size submitted to the venue, in contracts.","type":"number"},"submitted":{"description":"Whether the close order reached the venue at all.","type":"boolean"}},"type":"object"},"closedPercentage":{"description":"The percentage ACTUALLY closed, derived from the venue's filled size — never an echo of what you sent. ABSENT when amountConfirmed is false.","type":"number"},"closedPercentageVerified":{"description":"Mirrors amountConfirmed: false when the venue confirmed a fill without stating its size.","type":"boolean"},"closedSize":{"description":"Contracts the venue reported closing. ABSENT when amountConfirmed is false — it is never defaulted to the size you requested.","type":"number"},"closedSizeActual":{"description":"Contracts the venue reported closing. ABSENT when it did not state an amount.","type":"number"},"error":{"type":"string"},"estimatedPnlAtMark":{"description":"An ESTIMATE of what this close was worth: (mark price read just after the close - your entry price) x the venue's CONFIRMED closed size. Not a realised result — it is not the price the close filled at, and it excludes fees and funding. ABSENT when amountConfirmed is false or the mark-price read failed.","type":"string"},"exitPrice":{"description":"Mark price read just after the close, not the venue fill price.","type":"number"},"fullyClosedAsRequested":{"description":"Present only when the venue's own size proves it either way.","type":"boolean"},"message":{"description":"Buyer-facing sentence describing the outcome and what, if anything, to do.","type":"string"},"requestedPercentage":{"description":"The percentage you asked to close. A request, never a result.","type":"number"},"requestedSize":{"description":"Contracts submitted to close, for comparison with closedSizeActual. A request, never a result.","type":"number"},"shortfall":{"description":"Present on a proven short close: contracts of your request that did NOT close and remain open.","type":"number"},"status":{"description":"'partial' when the venue's own size shows the close filled SHORT — the remainder of your position is still open and still carrying risk. 'success' when the venue confirmed the close filled — it is the only outcome that is charged for. 'failed' when the venue refused the close: NOTHING WAS CLOSED by this request and you are not charged. That is a statement about this order, not about your position — a trigger or a liquidation may have moved it, so check it rather than assuming it is untouched. 'unknown' when the close was submitted and its outcome could not be confirmed: check your position before retrying, because a retry may close more than you intended. You are not charged for that either.","enum":["success","partial","failed","unknown"],"type":"string"}},"required":["status"],"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-09-24","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.01,"price_match":true,"latency_ms":938,"error":null}],"description_full":"Close an open perpetual position on Hyperliquid (full or partial). Cancels all attached TP/SL trigger orders automatically.","last_updated":"2026-08-28T23:02:05.67Z","schemes":["exact"]}