Position Mode (Hedge / One-way)
Description
Query or change the position mode.
Primit only supports One-way Mode
Hedge mode is not supported. A POST that requests dualSidePosition=true
is rejected with -4059. Existing one-way
positions are unaffected; clients that read this field via GET will always
see false.
HTTP Request
- Query: GET
/fapi/v1/positionSide/dual(HMAC SHA256) - Change: POST
/fapi/v1/positionSide/dual(HMAC SHA256)
Weight
1
Request Parameters (POST only)
| Name | Type | Required | Description |
|---|---|---|---|
| dualSidePosition | BOOL or STRING | YES | "true" / "false" / true / false. Only false is accepted; true returns -4059. |
| recvWindow | LONG | NO | See Endpoint Security Type |
| timestamp | LONG | YES | Timestamp |
Response Example (GET)
{
"dualSidePosition": true // true: Hedge Mode; false: One-way Mode
}
Response Example (POST)
{
"code": 200,
"msg": "success"
}
Code Examples
curl (query)
API_KEY="your_api_key"
API_SECRET="your_api_secret"
TIMESTAMP=$(date +%s%3N)
QUERY_STRING="timestamp=${TIMESTAMP}"
SIGNATURE=$(echo -n "${QUERY_STRING}" | openssl dgst -sha256 -hmac "${API_SECRET}" | awk '{print $2}')
curl -s -H "X-MBX-APIKEY: ${API_KEY}" \
"https://api-sepolia.primit.io/fapi/v1/positionSide/dual?${QUERY_STRING}&signature=${SIGNATURE}"