Skip to main content
POST
/
v1
/
exchange
/
updateLeverage
Update Leverage
curl --request POST \
  --url https://api.hypereth.io/v1/exchange/updateLeverage \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "action": {
    "type": "updateLeverage",
    "asset": 123,
    "isCross": true,
    "leverage": 123
  },
  "nonce": 123,
  "signature": {}
}'
{
  "status": "ok",
  "response": {
    "type": "updateLeverage",
    "data": {
      "asset": 123,
      "leverage": 123
    }
  }
}

Authorizations

Authorization
string
header
required

Hyperliquid uses a custom signing scheme for authentication.

Required for: All /exchange endpoints

Format: Signature generated using private key + nonce + action data

Headers:

  • Authorization: Signature
  • Content-Type: application/json

Important Notes:

  • Use official SDKs to avoid signing errors
  • Nonce must be current timestamp in milliseconds
  • Address fields must be lowercase
  • Order of fields in msgpack serialization matters

Common Pitfalls:

  • Not understanding the two signing schemes
  • Trailing zeros on numbers
  • Case sensitivity on addresses
  • Incorrect field ordering

Body

application/json
action
object
required
nonce
integer
required
signature
object
required

Response

Leverage updated successfully

Leverage update response

status
enum<string>
Available options:
ok,
err
response
object