Update leverage
Endpoint
POST /exchange
Selector: action.type: "updateLeverage"
Purpose
Changes the customer's cross-margin leverage setting inside Hermit's private risk book.
Authorization
Owner or permitted trading agent. The SDK signs the action; see raw signing for custom clients.
Request fields
| Field | Type | Required | Meaning |
|---|---|---|---|
action | Object | Yes | The supported action described below. |
nonce | Unsigned integer | Yes | Trading nonce; native-style millisecond timestamp convention. |
signature | Object | Yes | Wallet signature containing r, s and recovery byte v (27 or 28). |
expiresAfter | Unsigned integer or null | No | Request expiry in Unix milliseconds. |
vaultAddress | Null | No | Omit or use null; customer subaccount/vault routing is outside this profile. |
The action object contains:
| Field | Type | Required | Meaning |
|---|---|---|---|
action.type | String | Yes | "updateLeverage". |
action.asset | Unsigned integer | Yes | Supported perpetual asset index. |
action.isCross | Boolean | Yes | true; isolated margin is outside this profile. |
action.leverage | Positive integer | Yes | Requested customer leverage, subject to policy limits. |
See the shared trading envelope for the common signing and routing fields.
Request example
The proof and market are illustrative.
{
"action": {
"type": "updateLeverage",
"asset": 0,
"isCross": true,
"leverage": 5
},
"nonce": 1796250000000,
"signature": {
"r": "0x1111111111111111111111111111111111111111111111111111111111111111",
"s": "0x2222222222222222222222222222222222222222222222222222222222222222",
"v": 27
}
}Response fields
| Field | Meaning |
|---|---|
status | "ok" for a successful update or "err" for a risk rejection. |
response | Response object on success; a reason string for a risk rejection. |
response.type | "default" for a successful update. |
A risk rejection can return {"status":"err","response":"<reason>"}.
Response example
{
"status": "ok",
"response": {
"type": "default"
}
}Constraints
Only cross-margin leverage is supported: action.isCross must be true. The customer setting remains bounded by the configured market and risk policy.
This action does not reconfigure the pooled Hyperliquid account's venue leverage. Successful admission changes the customer's risk setting; it is not proof of a separate native leverage transaction.