> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.chainstack.com/feedback

```json
{
  "path": "/reference/hyperliquid-exchange-batch-modify",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Batch modify orders | Hyperliquid exchange

<Info>
  You can only use this endpoint on the official Hyperliquid public API. It is not available through Chainstack, as the open-source node implementation does not support it yet. See [Hyperliquid methods](/docs/hyperliquid-methods) for the full availability breakdown.
</Info>

<Note>
  This endpoint requires signature authentication. See our comprehensive [Authentication via Signatures guide](/docs/hyperliquid-authentication-guide) for implementation details.
</Note>

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.

<Check>
  **Get your own node endpoint today**

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## 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

<CodeGroup>
  ```shell cURL theme={"system"}
  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": {...}
    }'
  ```

  ```python Python theme={"system"}
  from hyperliquid.exchange import Exchange
  from hyperliquid.utils import constants
  import eth_account

  # Initialize with your private key
  account = eth_account.Account.from_key("0x...")
  exchange = Exchange(account, constants.MAINNET_API_URL)

  # Modify multiple orders at once
  modifications = [
      {
          "oid": 77738308,
          "coin": "BTC",
          "is_buy": True,
          "sz": 0.02,
          "limit_px": 51000,
          "order_type": {"limit": {"tif": "Gtc"}}
      },
      {
          "oid": 77738309,
          "coin": "ETH",
          "is_buy": False,
          "sz": 0.5,
          "limit_px": 3200,
          "order_type": {"limit": {"tif": "Gtc"}}
      }
  ]

  batch_result = exchange.batch_modify_orders(modifications)
  print(batch_result)
  ```
</CodeGroup>

## 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

<Note>
  Batch modifications are processed sequentially in the order provided. If one modification fails, it doesn't affect the others in the batch.
</Note>

<Warning>
  Each modification in the batch counts toward rate limits. Ensure you don't exceed rate limits when modifying many orders at once.
</Warning>


## OpenAPI

````yaml /openapi/hyperliquid_node_api/exchange_batch_modify.json post /exchange
openapi: 3.0.0
info:
  title: Hyperliquid Exchange API
  version: 1.0.0
  description: >-
    API for trading operations on Hyperliquid exchange requiring authentication.
    ⚠️ WARNING: These endpoints require EIP-712 signatures for authentication.
    The example values provided will NOT work without proper cryptographic
    signing. You must implement EIP-712 signing to use these endpoints
    successfully.
servers:
  - url: https://api.hyperliquid.xyz
security: []
paths:
  /exchange:
    post:
      tags:
        - hyperliquid exchange
      summary: Batch modify orders
      operationId: batchModifyOrders
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                action:
                  type: object
                  properties:
                    type:
                      type: string
                      default: batchModify
                      enum:
                        - batchModify
                      description: Action type for batch modifying orders
                    modifies:
                      type: array
                      description: Array of modify objects
                      items:
                        type: object
                        properties:
                          oid:
                            type: integer
                            description: Order ID to modify
                          order:
                            type: object
                            description: New order parameters
                            properties:
                              a:
                                type: integer
                                description: >-
                                  Asset index (use universe index for perps,
                                  10000 + index for spot)
                              b:
                                type: boolean
                                description: >-
                                  Is buy order (true for buy/long, false for
                                  sell/short)
                              p:
                                type: string
                                description: Limit price (use '0' for market orders)
                              s:
                                type: string
                                description: Size in units of the base asset
                              r:
                                type: boolean
                                description: Reduce only order
                              t:
                                type: object
                                description: Order type specification
                                oneOf:
                                  - type: object
                                    properties:
                                      limit:
                                        type: object
                                        properties:
                                          tif:
                                            type: string
                                            enum:
                                              - Alo
                                              - Ioc
                                              - Gtc
                                            description: >-
                                              Time in force: Alo (add liquidity only),
                                              Ioc (immediate or cancel), Gtc (good til
                                              canceled)
                                        required:
                                          - tif
                                  - type: object
                                    properties:
                                      trigger:
                                        type: object
                                        properties:
                                          isMarket:
                                            type: boolean
                                            description: >-
                                              Whether to place market order when
                                              triggered
                                          triggerPx:
                                            type: string
                                            description: Price at which to trigger the order
                                          tpsl:
                                            type: string
                                            enum:
                                              - tp
                                              - sl
                                            description: Take profit (tp) or stop loss (sl)
                                        required:
                                          - isMarket
                                          - triggerPx
                                          - tpsl
                              c:
                                type: string
                                description: Client order ID (128-bit hex string, optional)
                            required:
                              - a
                              - b
                              - p
                              - s
                              - r
                              - t
                        required:
                          - oid
                          - order
                  required:
                    - type
                    - modifies
                nonce:
                  type: integer
                  description: Current timestamp in milliseconds
                signature:
                  type: object
                  description: EIP-712 signature of the action with r, s, v components
                  properties:
                    r:
                      type: string
                      description: ECDSA signature r component (hex string)
                      example: >-
                        0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
                    s:
                      type: string
                      description: ECDSA signature s component (hex string)
                      example: >-
                        0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321
                    v:
                      type: integer
                      description: ECDSA recovery id (27 or 28)
                      example: 27
                  required:
                    - r
                    - s
                    - v
                vaultAddress:
                  type: string
                  description: >-
                    Address when trading on behalf of a vault or subaccount
                    (optional)
                  nullable: true
                expiresAfter:
                  type: integer
                  description: >-
                    Timestamp in milliseconds after which the request is
                    rejected (optional)
              required:
                - action
                - nonce
                - signature
            example:
              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
      responses:
        '200':
          description: Batch modification result
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Request status
                  response:
                    type: object
                    properties:
                      type:
                        type: string
                      data:
                        type: object
                        properties:
                          statuses:
                            type: array
                            items:
                              oneOf:
                                - type: object
                                  properties:
                                    resting:
                                      type: object
                                      properties:
                                        oid:
                                          type: integer
                                          description: Order ID
                                - type: object
                                  properties:
                                    filled:
                                      type: object
                                      properties:
                                        totalSz:
                                          type: string
                                          description: Total size filled
                                        avgPx:
                                          type: string
                                          description: Average fill price
                                        oid:
                                          type: integer
                                          description: Order ID
                                - type: object
                                  properties:
                                    error:
                                      type: string
                                      description: Error message
                example:
                  status: ok
                  response:
                    type: batchModify
                    data:
                      statuses:
                        - resting:
                            oid: 77738310
                        - resting:
                            oid: 77738311

````