Skip to content
LogoLogo

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

FieldTypeRequiredMeaning
actionObjectYesThe supported action described below.
nonceUnsigned integerYesTrading nonce; native-style millisecond timestamp convention.
signatureObjectYesWallet signature containing r, s and recovery byte v (27 or 28).
expiresAfterUnsigned integer or nullNoRequest expiry in Unix milliseconds.
vaultAddressNullNoOmit or use null; customer subaccount/vault routing is outside this profile.

The action object contains:

FieldTypeRequiredMeaning
action.typeStringYes"updateLeverage".
action.assetUnsigned integerYesSupported perpetual asset index.
action.isCrossBooleanYestrue; isolated margin is outside this profile.
action.leveragePositive integerYesRequested 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

FieldMeaning
status"ok" for a successful update or "err" for a risk rejection.
responseResponse 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.