POST
/
exchange
Batch modify orders
curl --request POST \
  --url https://api.hyperliquid.xyz/exchange \
  --header 'Content-Type: application/json' \
  --data '{
  "action": {
    "type": "batchModify",
    "modifies": [
      {
        "oid": 123456789,
        "order": {
          "a": 0,
          "b": true,
          "p": "27.5",
          "s": "1.0",
          "r": false,
          "t": {
            "limit": {
              "tif": "Gtc"
            }
          },
          "c": "0x1234567890abcdef1234567890abcdef"
        }
      },
      {
        "oid": 123456790,
        "order": {
          "a": 0,
          "b": false,
          "p": "28.0",
          "s": "0.5",
          "r": false,
          "t": {
            "limit": {
              "tif": "Gtc"
            }
          }
        }
      }
    ]
  },
  "nonce": 1705234567890,
  "signature": {
    "r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
    "s": "0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321",
    "v": 27
  },
  "vaultAddress": null
}'
{
  "status": "ok",
  "response": {
    "type": "batchModify",
    "data": {
      "statuses": [
        {
          "resting": {
            "oid": 77738310
          }
        },
        {
          "resting": {
            "oid": 77738311
          }
        }
      ]
    }
  }
}
This endpoint requires signature authentication. See our comprehensive Authentication via Signatures guide for implementation details.
Modifies multiple existing orders in a single atomic request on the Hyperliquid exchange. This is more efficient than sending individual modify requests for each order.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

Required parameters

  • action (object, required) — The batch modify action object containing:
    • type (string) — Must be "batchModify"
    • modifies (array) — Array of modification objects, each containing:
      • oid (number or string) — Order ID to modify, or cloid if using client order ID
      • order (object) — New order parameters:
        • a (number) — Asset index
        • b (boolean) — Is buy order (true for buy/long, false for sell/short)
        • p (string) — New limit price
        • s (string) — New size in units of the base asset
        • r (boolean) — Reduce only order
        • t (object) — Order type specification:
          • For limit orders: {"limit": {"tif": "Alo" | "Ioc" | "Gtc"}}
          • For trigger orders: {"trigger": {"isMarket": boolean, "triggerPx": string, "tpsl": "tp" | "sl"}}
        • c (string, optional) — New client order ID (128-bit hex string)
  • nonce (number, required) — Current timestamp in milliseconds (must be recent)
  • signature (object, required) — EIP-712 signature of the action

Optional parameters

  • vaultAddress (string, optional) — Address when trading on behalf of a vault or subaccount
  • expiresAfter (number, optional) — Timestamp in milliseconds after which the request is rejected

Returns

Returns an object with batch modification status:
  • status"ok" if request processed
  • response — Contains modification details:
    • type"batchModify"
    • data.statuses — Array of modification results for each order

Example request

curl -X POST https://api.hyperliquid.xyz/exchange \
  -H "Content-Type: application/json" \
  -d '{
    "action": {
      "type": "batchModify",
      "modifies": [
        {
          "oid": 77738308,
          "order": {
            "a": 0,
            "b": true,
            "p": "51000",
            "s": "0.02",
            "r": false,
            "t": {"limit": {"tif": "Gtc"}}
          }
        },
        {
          "oid": 77738309,
          "order": {
            "a": 1,
            "b": false,
            "p": "3200",
            "s": "0.5",
            "r": false,
            "t": {"limit": {"tif": "Gtc"}}
          }
        }
      ]
    },
    "nonce": 1234567890123,
    "signature": {...}
  }'

Batch processing

  • Atomic execution — All modifications are processed together
  • Independent validation — Each modification is validated independently
  • Partial success — Some orders may succeed while others fail
  • Efficiency — Single signature and request for multiple modifications

Use cases

  • Market making — Update multiple orders across different price levels
  • Portfolio management — Adjust multiple positions simultaneously
  • Grid trading — Modify entire grids of orders efficiently
  • Strategy updates — Bulk update orders when strategy parameters change
Batch modifications are processed sequentially in the order provided. If one modification fails, it doesn’t affect the others in the batch.
Each modification in the batch counts toward rate limits. Ensure you don’t exceed rate limits when modifying many orders at once.

Body

application/json

Response

200 - application/json

Batch modification result

The response is of type object.