curl --request POST \
--url https://api.hyperliquid.xyz/exchange \
--header 'Content-Type: application/json' \
--data '
{
"action": {
"type": "order",
"orders": [
{
"a": 0,
"b": true,
"p": "50000.0",
"s": "0.01",
"r": false,
"t": {
"limit": {
"tif": "Alo"
}
},
"c": "<string>"
}
],
"grouping": "na",
"builder": {
"b": "<string>",
"f": 123
}
},
"nonce": 1734567890123,
"signature": {
"r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"s": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"v": 28
},
"vaultAddress": "0x0000000000000000000000000000000000000000",
"expiresAfter": 123
}
'{
"status": "ok",
"response": {
"type": "order",
"data": {
"statuses": [
{
"resting": {
"oid": 77738308
}
}
]
}
}
}curl --request POST \
--url https://api.hyperliquid.xyz/exchange \
--header 'Content-Type: application/json' \
--data '
{
"action": {
"type": "order",
"orders": [
{
"a": 0,
"b": true,
"p": "50000.0",
"s": "0.01",
"r": false,
"t": {
"limit": {
"tif": "Alo"
}
},
"c": "<string>"
}
],
"grouping": "na",
"builder": {
"b": "<string>",
"f": 123
}
},
"nonce": 1734567890123,
"signature": {
"r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"s": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"v": 28
},
"vaultAddress": "0x0000000000000000000000000000000000000000",
"expiresAfter": 123
}
'{
"status": "ok",
"response": {
"type": "order",
"data": {
"statuses": [
{
"resting": {
"oid": 77738308
}
}
]
}
}
}action (object, required) — The order action object containing:
type (string) — Must be "order"orders (array) — Array of order objects with:
a (number) — Asset index (see asset notation below)b (boolean) — Is buy order (true for buy/long, false for sell/short)p (string) — Limit price (use “0” for market orders)s (string) — Size in units of the base assetr (boolean) — Reduce only ordert (object) — Order type specification:
{"limit": {"tif": "Alo" | "Ioc" | "Gtc"}}{"trigger": {"isMarket": boolean, "triggerPx": string, "tpsl": "tp" | "sl"}}c (string, optional) — Client order ID (128-bit hex string)grouping (string) — Order grouping: "na" | "normalTpsl" | "positionTpsl"builder (object, optional) — Builder fee configuration:
b (string) — Builder address to receive feesf (number) — Fee in tenths of a basis pointnonce (number, required) — Current timestamp in milliseconds (must be recent)
signature (object, required) — EIP-712 signature of the action
vaultAddress (string, optional) — Address when trading on behalf of a vault or subaccountexpiresAfter (number, optional) — Timestamp in milliseconds after which the order is rejecteduniverse field in the meta response. For spot assets, use 10000 + index where index is from spotMeta.universe.
Example: PURR/USDC spot has index 0 in spot metadata, so use asset 10000.
Alo — Add liquidity only (post-only), canceled if would immediately matchIoc — Immediate or cancel, unfilled portion canceledGtc — Good til canceled, rests on book until filled or canceledtp — Take profit ordersl — Stop loss orderisMarket — Whether to place market order when triggeredtriggerPx — Price at which to trigger the orderstatus — "ok" if successfulresponse — Contains order details:
type — "order"data.statuses — Array of status objects for each order:
resting — Order placed on book with oid (order ID)filled — Order immediately filled with totalSz, avgPx, and oiderror — Error message if order failedcurl -X POST https://api.hyperliquid.xyz/exchange \
-H "Content-Type: application/json" \
-d '{
"action": {
"type": "order",
"orders": [{
"a": 0,
"b": true,
"p": "50000",
"s": "0.01",
"r": false,
"t": {"limit": {"tif": "Gtc"}}
}],
"grouping": "na"
},
"nonce": 1234567890123,
"signature": {...}
}'
{
"status": "ok",
"response": {
"type": "order",
"data": {
"statuses": [{
"resting": {
"oid": 77738308
}
}]
}
}
}
{
"status": "ok",
"response": {
"type": "order",
"data": {
"statuses": [{
"filled": {
"totalSz": "0.02",
"avgPx": "1891.4",
"oid": 77747314
}
}]
}
}
}
{
"status": "ok",
"response": {
"type": "order",
"data": {
"statuses": [{
"error": "Order must have minimum value of $10."
}]
}
}
}
expiresAfter field consumes 5x rate limit when orders expire due to staleness.Show child attributes
Action type for placing orders
order Array of order objects to place
Show child attributes
Asset index (use universe index for perps, 10000 + index for spot)
0
Is buy order (true for buy/long, false for sell/short)
true
Limit price (use '0' for market orders)
"50000.0"
Size in units of the base asset
"0.01"
Reduce only order
false
Client order ID (128-bit hex string, optional)
Order grouping type
na, normalTpsl, positionTpsl Current timestamp in milliseconds
1734567890123
EIP-712 signature of the action. REQUIRED for authentication. Must be properly signed.
Show child attributes
R component of signature
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
S component of signature
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
V component of signature
28
Address when trading on behalf of a vault or subaccount (optional)
"0x0000000000000000000000000000000000000000"
Timestamp in milliseconds after which the order is rejected (optional)
Order placement result
Request status
Was this page helpful?