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
}
'import requests
url = "https://api.hyperliquid.xyz/exchange"
payload = {
"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": None
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
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
})
};
fetch('https://api.hyperliquid.xyz/exchange', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperliquid.xyz/exchange",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hyperliquid.xyz/exchange"
payload := strings.NewReader("{\n \"action\": {\n \"type\": \"batchModify\",\n \"modifies\": [\n {\n \"oid\": 123456789,\n \"order\": {\n \"a\": 0,\n \"b\": true,\n \"p\": \"27.5\",\n \"s\": \"1.0\",\n \"r\": false,\n \"t\": {\n \"limit\": {\n \"tif\": \"Gtc\"\n }\n },\n \"c\": \"0x1234567890abcdef1234567890abcdef\"\n }\n },\n {\n \"oid\": 123456790,\n \"order\": {\n \"a\": 0,\n \"b\": false,\n \"p\": \"28.0\",\n \"s\": \"0.5\",\n \"r\": false,\n \"t\": {\n \"limit\": {\n \"tif\": \"Gtc\"\n }\n }\n }\n }\n ]\n },\n \"nonce\": 1705234567890,\n \"signature\": {\n \"r\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\",\n \"s\": \"0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321\",\n \"v\": 27\n },\n \"vaultAddress\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hyperliquid.xyz/exchange")
.header("Content-Type", "application/json")
.body("{\n \"action\": {\n \"type\": \"batchModify\",\n \"modifies\": [\n {\n \"oid\": 123456789,\n \"order\": {\n \"a\": 0,\n \"b\": true,\n \"p\": \"27.5\",\n \"s\": \"1.0\",\n \"r\": false,\n \"t\": {\n \"limit\": {\n \"tif\": \"Gtc\"\n }\n },\n \"c\": \"0x1234567890abcdef1234567890abcdef\"\n }\n },\n {\n \"oid\": 123456790,\n \"order\": {\n \"a\": 0,\n \"b\": false,\n \"p\": \"28.0\",\n \"s\": \"0.5\",\n \"r\": false,\n \"t\": {\n \"limit\": {\n \"tif\": \"Gtc\"\n }\n }\n }\n }\n ]\n },\n \"nonce\": 1705234567890,\n \"signature\": {\n \"r\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\",\n \"s\": \"0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321\",\n \"v\": 27\n },\n \"vaultAddress\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperliquid.xyz/exchange")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"action\": {\n \"type\": \"batchModify\",\n \"modifies\": [\n {\n \"oid\": 123456789,\n \"order\": {\n \"a\": 0,\n \"b\": true,\n \"p\": \"27.5\",\n \"s\": \"1.0\",\n \"r\": false,\n \"t\": {\n \"limit\": {\n \"tif\": \"Gtc\"\n }\n },\n \"c\": \"0x1234567890abcdef1234567890abcdef\"\n }\n },\n {\n \"oid\": 123456790,\n \"order\": {\n \"a\": 0,\n \"b\": false,\n \"p\": \"28.0\",\n \"s\": \"0.5\",\n \"r\": false,\n \"t\": {\n \"limit\": {\n \"tif\": \"Gtc\"\n }\n }\n }\n }\n ]\n },\n \"nonce\": 1705234567890,\n \"signature\": {\n \"r\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\",\n \"s\": \"0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321\",\n \"v\": 27\n },\n \"vaultAddress\": null\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"response": {
"type": "batchModify",
"data": {
"statuses": [
{
"resting": {
"oid": 77738310
}
},
{
"resting": {
"oid": 77738311
}
}
]
}
}
}Hyperliquid node API
Batch modify orders | Hyperliquid exchange
Modifies multiple existing orders in a single atomic request on the Hyperliquid exchange. Chainstack Hyperliquid exchange reference.
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
}
'import requests
url = "https://api.hyperliquid.xyz/exchange"
payload = {
"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": None
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
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
})
};
fetch('https://api.hyperliquid.xyz/exchange', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperliquid.xyz/exchange",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hyperliquid.xyz/exchange"
payload := strings.NewReader("{\n \"action\": {\n \"type\": \"batchModify\",\n \"modifies\": [\n {\n \"oid\": 123456789,\n \"order\": {\n \"a\": 0,\n \"b\": true,\n \"p\": \"27.5\",\n \"s\": \"1.0\",\n \"r\": false,\n \"t\": {\n \"limit\": {\n \"tif\": \"Gtc\"\n }\n },\n \"c\": \"0x1234567890abcdef1234567890abcdef\"\n }\n },\n {\n \"oid\": 123456790,\n \"order\": {\n \"a\": 0,\n \"b\": false,\n \"p\": \"28.0\",\n \"s\": \"0.5\",\n \"r\": false,\n \"t\": {\n \"limit\": {\n \"tif\": \"Gtc\"\n }\n }\n }\n }\n ]\n },\n \"nonce\": 1705234567890,\n \"signature\": {\n \"r\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\",\n \"s\": \"0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321\",\n \"v\": 27\n },\n \"vaultAddress\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hyperliquid.xyz/exchange")
.header("Content-Type", "application/json")
.body("{\n \"action\": {\n \"type\": \"batchModify\",\n \"modifies\": [\n {\n \"oid\": 123456789,\n \"order\": {\n \"a\": 0,\n \"b\": true,\n \"p\": \"27.5\",\n \"s\": \"1.0\",\n \"r\": false,\n \"t\": {\n \"limit\": {\n \"tif\": \"Gtc\"\n }\n },\n \"c\": \"0x1234567890abcdef1234567890abcdef\"\n }\n },\n {\n \"oid\": 123456790,\n \"order\": {\n \"a\": 0,\n \"b\": false,\n \"p\": \"28.0\",\n \"s\": \"0.5\",\n \"r\": false,\n \"t\": {\n \"limit\": {\n \"tif\": \"Gtc\"\n }\n }\n }\n }\n ]\n },\n \"nonce\": 1705234567890,\n \"signature\": {\n \"r\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\",\n \"s\": \"0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321\",\n \"v\": 27\n },\n \"vaultAddress\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperliquid.xyz/exchange")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"action\": {\n \"type\": \"batchModify\",\n \"modifies\": [\n {\n \"oid\": 123456789,\n \"order\": {\n \"a\": 0,\n \"b\": true,\n \"p\": \"27.5\",\n \"s\": \"1.0\",\n \"r\": false,\n \"t\": {\n \"limit\": {\n \"tif\": \"Gtc\"\n }\n },\n \"c\": \"0x1234567890abcdef1234567890abcdef\"\n }\n },\n {\n \"oid\": 123456790,\n \"order\": {\n \"a\": 0,\n \"b\": false,\n \"p\": \"28.0\",\n \"s\": \"0.5\",\n \"r\": false,\n \"t\": {\n \"limit\": {\n \"tif\": \"Gtc\"\n }\n }\n }\n }\n ]\n },\n \"nonce\": 1705234567890,\n \"signature\": {\n \"r\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\",\n \"s\": \"0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321\",\n \"v\": 27\n },\n \"vaultAddress\": null\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"response": {
"type": "batchModify",
"data": {
"statuses": [
{
"resting": {
"oid": 77738310
}
},
{
"resting": {
"oid": 77738311
}
}
]
}
}
}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 for the full availability breakdown.
This endpoint requires signature authentication. See our comprehensive Authentication via Signatures guide for implementation details.
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 IDorder(object) — New order parameters:a(number) — Asset indexb(boolean) — Is buy order (true for buy/long, false for sell/short)p(string) — New limit prices(string) — New size in units of the base assetr(boolean) — Reduce only ordert(object) — Order type specification:- For limit orders:
{"limit": {"tif": "Alo" | "Ioc" | "Gtc"}} - For trigger orders:
{"trigger": {"isMarket": boolean, "triggerPx": string, "tpsl": "tp" | "sl"}}
- For limit orders:
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 subaccountexpiresAfter(number, optional) — Timestamp in milliseconds after which the request is rejected
Returns
Returns an object with batch modification status:status—"ok"if request processedresponse— 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": {...}
}'
from hyperliquid.exchange import Exchange
from hyperliquid.utils import constants
import eth_account
# Initialize with your private key (public Hyperliquid API)
account = eth_account.Account.from_key("0x...")
exchange = Exchange(account, constants.MAINNET_API_URL)
# Modify multiple orders at once
modifies = [
{
"oid": 77738308,
"order": {
"coin": "BTC",
"is_buy": True,
"sz": 0.02,
"limit_px": 51000,
"order_type": {"limit": {"tif": "Gtc"}},
"reduce_only": False,
},
},
{
"oid": 77738309,
"order": {
"coin": "ETH",
"is_buy": False,
"sz": 0.5,
"limit_px": 3200,
"order_type": {"limit": {"tif": "Gtc"}},
"reduce_only": False,
},
},
]
batch_result = exchange.bulk_modify_orders_new(modifies)
print(batch_result)
import { ExchangeClient, HttpTransport } from "@nktkas/hyperliquid";
import { privateKeyToAccount } from "viem/accounts";
// Initialize with your private key (public Hyperliquid API)
const wallet = privateKeyToAccount("0x...");
const transport = new HttpTransport();
const exchange = new ExchangeClient({ transport, wallet });
// Modify multiple orders at once
const result = await exchange.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" } },
},
},
],
});
console.log(result);
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
Show child attributes
Show child attributes
Current timestamp in milliseconds
EIP-712 signature of the action with r, s, v components
Show child attributes
Show child attributes
Address when trading on behalf of a vault or subaccount (optional)
Timestamp in milliseconds after which the request is rejected (optional)
Last modified on July 7, 2026
Was this page helpful?
⌘I