HyperliquidHyperliquid REST APITrading
Place Order
Place new orders on the exchange. Supports limit, market, and trigger orders.
Rate Limit: 1 + floor(batch_length / 40) weight
Authentication: Required
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
type*enum<string>required
Action type
Available options:
orderorders*array<object>required
Orders to place
Array items:
a*integerrequired
Asset index
Example:
0b*booleanrequired
Buy (true) or sell (false)
p*stringrequired
Limit price
Example:
43250.0s*stringrequired
Order size
Example:
0.1r*booleanrequired
Reduce-only flag
t?object
Order type specification
limit?object
tif?enum<string>
Time in force
Available options:
AloIocGtctrigger?object
triggerPx?string
Trigger price
isMarket?boolean
Execute as market order
tpsl?enum<string>
Take profit or stop loss
Available options:
tpslcloid?string
Client order ID
nonce*integerrequired
Current timestamp in milliseconds
signature*objectrequired
r*stringrequired
s*stringrequired
v*integerrequired
vaultAddress?string
Optional vault address
Response Body
application/json
application/json
application/json
curl -X POST "https://api.hypereth.io/v1/exchange/order" \ -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": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "s": "0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321", "v": 27 } }'{
"status": "ok",
"response": {
"type": "order",
"data": {
"statuses": [
{
"resting": {
"oid": 0
}
}
]
}
}
}{
"error": "Insufficient margin for order placement",
"code": 1001,
"details": {}
}{
"error": "Insufficient margin for order placement",
"code": 1001,
"details": {}
}