curl --request POST \
--url https://api.hyperliquid.xyz/exchange \
--header 'Content-Type: application/json' \
--data '{
"action": {
"type": "updateLeverage",
"asset": 0,
"isCross": false,
"leverage": 10
},
"nonce": 1705234567890,
"signature": {
"r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"s": "0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321",
"v": 27
},
"vaultAddress": null
}'
{
"status": "ok",
"response": {
"type": "updateLeverage",
"data": {
"status": "success"
}
}
}
curl --request POST \
--url https://api.hyperliquid.xyz/exchange \
--header 'Content-Type: application/json' \
--data '{
"action": {
"type": "updateLeverage",
"asset": 0,
"isCross": false,
"leverage": 10
},
"nonce": 1705234567890,
"signature": {
"r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"s": "0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321",
"v": 27
},
"vaultAddress": null
}'
{
"status": "ok",
"response": {
"type": "updateLeverage",
"data": {
"status": "success"
}
}
}
action
(object, required) — The update leverage action object containing:
type
(string) — Must be "updateLeverage"
asset
(number) — Asset index of the coinisCross
(boolean) — true
for cross leverage, false
for isolated leverageleverage
(number) — New leverage value (must be within allowed range for the asset)nonce
(number, required) — Current timestamp in milliseconds (must be recent)
signature
(object, required) — EIP-712 signature of the action
vaultAddress
(string, optional) — Address when trading on behalf of a vault or subaccountexpiresAfter
(number, optional) — Timestamp in milliseconds after which the request is rejectedstatus
— "ok"
if successfulresponse
— Contains update details:
type
— "default"
curl -X POST https://api.hyperliquid.xyz/exchange \
-H "Content-Type: application/json" \
-d '{
"action": {
"type": "updateLeverage",
"asset": 0,
"isCross": true,
"leverage": 10
},
"nonce": 1234567890123,
"signature": {...}
}'
{
"status": "ok",
"response": {
"type": "default"
}
}
Leverage update result
The response is of type object
.