HyperliquidHyperliquid REST APIOfficial hyperliquid methods

Hyperliquid Exchange Endpoint

Exchange operations endpoint that transparently forwards requests to Hyperliquid's official RPC.

Legacy Behavior: This endpoint accepts any valid Hyperliquid exchange request and forwards it unchanged to the official Hyperliquid RPC endpoint. The response from Hyperliquid is returned without modification.

Supported Actions: All Hyperliquid exchange actions are supported, including but not limited to:

  • Trading: order, cancel, modify, batchModify
  • Risk Management: updateLeverage, updateIsolatedMargin
  • Advanced: twapOrder, scheduleCancel
  • Account: usdTransfer, spotTransfer, withdraw

Authentication: Requests must include valid cryptographic signatures as per Hyperliquid's requirements. The signature and all authentication parameters are forwarded unchanged.

For specific action documentation, see the individual endpoint paths or refer to Hyperliquid's official documentation.

Rate Limit: 1 + floor(batch_length / 40) weight

POST
/v1/hl/exchange

Authorization

HyperliquidSignature
Authorization<token>

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

In: header

Request Body

application/json

action*objectrequired

The specific exchange action to perform

nonce*integerrequired

Current timestamp in milliseconds

signature*objectrequired

Cryptographic signature for authentication

vaultAddress?string

Optional vault address for subaccount operations

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.hypereth.io/v1/hl/exchange" \  -H "Content-Type: application/json" \  -d '{    "action": {      "type": "order",      "orders": [        {          "a": 0,          "b": true,          "p": "43250.0",          "s": "0.1",          "r": false,          "t": {            "limit": {              "tif": "Gtc"            }          }        }      ]    },    "nonce": 1681923833000,    "signature": {      "r": "0x1234...",      "s": "0xfedc...",      "v": 27    }  }'
{
  "status": "string",
  "response": {}
}
{
  "error": "Insufficient margin for order placement",
  "code": 1001,
  "details": {}
}
{
  "error": "Insufficient margin for order placement",
  "code": 1001,
  "details": {}
}
{
  "error": "Insufficient margin for order placement",
  "code": 1001,
  "details": {}
}
{
  "error": "Insufficient margin for order placement",
  "code": 1001,
  "details": {}
}