POST
/
exchange
Update leverage
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"
    }
  }
}
This endpoint requires signature authentication. See our comprehensive Authentication via Signatures guide for implementation details.
Updates the leverage setting for a specific coin on the Hyperliquid exchange. You can adjust leverage for both cross and isolated margin modes.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

Required parameters

  • action (object, required) — The update leverage action object containing:
    • type (string) — Must be "updateLeverage"
    • asset (number) — Asset index of the coin
    • isCross (boolean) — true for cross leverage, false for isolated leverage
    • leverage (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

Optional parameters

  • vaultAddress (string, optional) — Address when trading on behalf of a vault or subaccount
  • expiresAfter (number, optional) — Timestamp in milliseconds after which the request is rejected

Leverage constraints

Each asset has specific leverage constraints:
  • Minimum leverage — Usually 1x
  • Maximum leverage — Varies by asset (3x to 40x depending on liquidity and volatility)
  • Cross margin — Shares margin across all positions
  • Isolated margin — Margin isolated to specific position

Returns

Returns an object with update status:
  • status"ok" if successful
  • response — Contains update details:
    • type"default"

Example request

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": {...}
  }'

Response example

{
  "status": "ok",
  "response": {
    "type": "default"
  }
}

Important considerations

  • Existing positions — Leverage changes affect margin requirements for existing positions
  • Liquidation risk — Increasing leverage increases liquidation risk
  • Available margin — Ensure sufficient margin before increasing leverage
  • Asset limits — Each asset has different maximum leverage limits

Use cases

  • Risk adjustment — Dynamically adjust risk based on market conditions
  • Capital efficiency — Optimize margin usage across positions
  • Strategy implementation — Set appropriate leverage for different trading strategies
  • Position management — Adjust leverage before opening new positions
Leverage is only checked when opening a position. After opening, monitor your positions to avoid liquidation as leverage effectively changes with unrealized PnL.
Increasing leverage on existing positions increases liquidation risk. Always ensure you have sufficient margin to support the new leverage level.

Body

application/json

Response

200 - application/json

Leverage update result

The response is of type object.