Close an open perpetual position on Hyperliquid (full or partial)
Close an open perpetual position on Hyperliquid (full or partial). Cancels all attached TP/SL trigger orders automatically.
Answeringour last check, 2026-09-24
1 of 1checks answered this week
938 msmedian answer time
$0.01listed price per call
$0.01price it asked us
Paid test badge: not yet. The checks above are free: we call the tool without paying and read the payment request it sends back. The Verified badge needs paid calls whose answers match the promised output, and nobody can buy a badge.
Endpoint
POST https://x402.ottoai.services/close-position
| Category | Everything else |
|---|---|
| Provider host | x402.ottoai.services |
| Networks | eip155:8453 |
| Payment schemes | exact |
| Self-reported calls, 30 days | 2 from 1 payers (the provider's figure, not ours) |
Our checks, last 30 days
| Day | Result | HTTP | Asked | Time |
|---|---|---|---|---|
| 2026-09-24 | valid payment request | 402 | $0.01 | 938 ms |
Example input (from the provider)
{
"body": {
"asset": "BTC",
"partialClosePercentage": 100
},
"bodyType": "json",
"method": "POST",
"type": "http"
}
Promised output schema (from the provider)
{
"$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 \u2014 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 \u2014 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 \u2014 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 \u2014 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 \u2014 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"
},
"sta