modify for one order and batchModify for multiple orders. Both are POST requests to https://api.hyperliquid.xyz/exchange. The field names below are from the Hyperliquid exchange-endpoint documentation as of 2026-11-18.
Identify the existing order: oid can be an oid or cloid
In both actions, the existing order is identified by an oid field that the docs type as Number | Cloid.
- For
modify, useaction.oid. - For
batchModify, use eachaction.modifies[i].oid. - A cloid is the optional client order ID used when placing an order; the docs describe it as a 128-bit hex string, e.g.
0x1234567890abcdef1234567890abcdef.
Replacement order fields
The replacement order object uses the same short keys as place-order entries:
| Key | Type | Meaning |
|---|---|---|
a | Number | Asset |
b | Boolean | isBuy |
p | String | Price |
s | String | Size |
r | Boolean | reduceOnly |
t | Object | Order type: limit or trigger |
c | Cloid, optional | Client order ID |
t, the docs show either:
{"limit": {"tif": "Alo" | "Ioc" | "Gtc"}}{"trigger": {"isMarket": Boolean, "triggerPx": String, "tpsl": "tp" | "sl"}}
a is the index in the universe field returned by the meta response. For spot assets, use 10000 + index, where index is the spot metadata index. For example, the docs use 10000 for PURR/USDC when its spot index is 0.
always_place: action-level a versus order-level a
The most confusing field is that a has two different meanings depending on location.
| Location | Meaning |
|---|---|
action.a in modify or batchModify | Optional always_place flag |
order.a inside the replacement order | Asset number |
always_place flag, encoded as a in the action.
- If
always_place = true, the docs say the new order is placed regardless of whether the cancel succeeded. - If
always_place = false, the new order must be a non-trigger order, and must have TIF = ALO or be a non-executable order with TIF = GTC. In the latter case, the docs say TIF is overridden to ALO. - The docs also say
amust be skipped if false. In other words, do not send"a": falsein the action; omit the key.
always_place replacement cannot be a trigger order, and certain GTC replacements are treated as ALO when non-executable.
modify request shape
Reference action object for a single order modification:
{
"type": "modify",
"oid": 77738308,
"order": {
"a": 0,
"b": true,
"p": "1891.4",
"s": "0.02",
"r": false,
"t": {
"limit": {
"tif": "Alo"
}
}
},
"a": true
}
If you are relying on the documented false behavior, omit the top-level "a" key:
{
"type": "modify",
"oid": "0x1234567890abcdef1234567890abcdef",
"order": {
"a": 0,
"b": true,
"p": "1891.4",
"s": "0.02",
"r": false,
"t": {
"limit": {
"tif": "Alo"
}
}
}
}
The outer request also requires nonce and signature; the docs recommend using the current timestamp in milliseconds for nonce. It also supports optional vaultAddress when acting for a subaccount or vault, and optional expiresAfter as a timestamp in milliseconds. Subaccounts and vaults do not have private keys; the master account signs and sets vaultAddress.
Like what you're reading? Try it yourself โ this link supports ChartedTrader at no cost to you.
Join Hyperliquid for a 4% fee discount on the first $25M of volume; Vaults and sub-accounts are excluded. โbatchModify request shape
Reference action object for multiple order modifications:
{
"type": "batchModify",
"modifies": [
{
"oid": 77738308,
"order": {
"a": 0,
"b": true,
"p": "1891.4",
"s": "0.02",
"r": false,
"t": {
"limit": {
"tif": "Alo"
}
}
}
},
{
"oid": "0x1234567890abcdef1234567890abcdef",
"order": {
"a": 10000,
"b": false,
"p": "0.5",
"s": "10",
"r": false,
"t": {
"limit": {
"tif": "Gtc"
}
}
}
}
],
"a": true
}
Again, omit the top-level "a" key if you need the documented false behavior.
What the docs do not show
The provided exchange-endpoint page does not include response examples for modify or batchModify. Therefore, this article does not infer a response shape, atomicity, or cancel-and-replace guarantee from the request schema. Treat those as undocumented here.
Source and next step
Source: Hyperliquid exchange endpoint documentation.
If you are building against Hyperliquid, you can join Hyperliquid. This article includes a referral link; if you sign up through it, the site may receive a commission. The exchange-endpoint docs do not describe referral discounts; see the Hyperliquid fees page for current referral and discount details.
Continue with Hyperliquid
Browse the Hyperliquid guide hub for the complete user journey.