Partial Close
Close a portion of an open position without exiting entirely.
quantity is in the base asset and must be less than the total position quantity. The currency is inherited from the position.
Request
# MARKET
curl -X POST "https://trade.mudrex.com/fapi/v1/futures/positions/{position_id}/close/partial" \
-H "Content-Type: application/json" \
-H "X-Authentication: your-secret-key" \
-d '{
"order_type": "MARKET",
"quantity": "0.1"
}'# LIMIT
curl -X POST "https://trade.mudrex.com/fapi/v1/futures/positions/{position_id}/close/partial" \
-H "Content-Type: application/json" \
-H "X-Authentication: your-secret-key" \
-d '{
"order_type": "LIMIT",
"quantity": "0.01",
"limit_price": "102.75"
}'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
position_id | string | Yes | The unique identifier of the position (path parameter). |
order_type | string | Yes | Order type: LIMIT or MARKET. |
quantity | string | Yes | Quantity to close (base asset; less than the total position quantity). |
limit_price | string | Conditional | Required if order_type is LIMIT. USDT price. |
Response
Status: 200 OK
{
"success": true,
"data": true
}Response fields
| Field | Description |
|---|---|
data | true when the partial close request is accepted. |
In testing, closing
0.1reduced the example position quantity from43.8to43.7.
Errors
Common errors
Position is not open
{
"success": false,
"errors": [
{
"code": 400,
"text": "position is not open"
}
]
}Status: 400 Bad Request
