๐Ÿ”Œ API & Developers

Hyperliquid modify and batchModify: Request Fields, oid/cloid, and always_place

โš ๏ธ Disclosure: Some links on this page are affiliate links. If you sign up through them, I may earn a commission โ€” at no extra cost to you.
Hyperliquid's exchange endpoint supports two related actions for changing existing orders: 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.

So you can target an order by a numeric oid or cloid. See Hyperliquid orderStatus Info Request: oid, cloid, and Response Shapes for how oid and cloid appear in order-status queries.

Replacement order fields

The replacement order object uses the same short keys as place-order entries:

KeyTypeMeaning
aNumberAsset
bBooleanisBuy
pStringPrice
sStringSize
rBooleanreduceOnly
tObjectOrder type: limit or trigger
cCloid, optionalClient order ID
For t, the docs show either: Asset values are not arbitrary strings. For perpetuals, 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.

LocationMeaning
action.a in modify or batchModifyOptional always_place flag
order.a inside the replacement orderAsset number
The docs say both single and batch modify actions include an optional always_place flag, encoded as a in the action. This restriction matters for limit-order TIF behavior: a non-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.

๐Ÿ’ก Hyperliquid

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. โ†’
๐ŸŽ You receive: 4% fee discount on first $25M volume ยท per account, lifetime

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.

๐Ÿงฎ Free Hyperliquid calculators

Fee Calculator โ†’
Hyperliquid vs centralized exchange fee comparison
PnL & Liquidation โ†’
Perp PnL + liquidation price
Position Size โ†’
Risk-aware position sizing for HL perps
Hyperliquid

Ready to get started? Use the link below โ€” it helps support 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. โ†’
๐ŸŽ You receive: 4% fee discount on first $25M volume ยท per account, lifetime
๐Ÿ“ˆ

About the author

I'm a systematic trader running live strategies on IB (USDJPY momentum) and Hyperliquid (crypto perps). Questions? Reach out.

๐Ÿ“š Related Articles

๐Ÿ”Œ
API & Developers

Hyperliquid orderStatus Info Request: oid, cloid, and Response Shapes

How to query one Hyperliquid order by numeric oid or client order ID using the info endpoint, with request fields, examples, and response shapes.

November 18, 2026 โฑ 4 min read
๐Ÿ”Œ
API & Developers

Hyperliquid frontendOpenOrders Info Endpoint: Trigger, Reduce-Only, and Order Type Fields

Query Hyperliquid's frontendOpenOrders POST /info endpoint, compare it with openOrders, and interpret trigger, reduce-only, orderType, and origSz fields.

November 16, 2026 โฑ 4 min read
๐Ÿ”Œ
API & Developers

Hyperliquid noop Action: Invalidate a Pending Nonce for In-Flight Orders

The Hyperliquid noop action marks a nonce as used without placing a trade, which can be more effective than cancel for invalidating in-flight orders.

November 11, 2026 โฑ 3 min read