batchModify - Atomic Order Modifications
Modify multiple orders atomically in a single transaction on Hyperliquid. Essential for market making and order management.
Modify multiple existing orders atomically in a single transaction. All modifications either succeed together or fail together, preventing partial updates that could expose unwanted risk.
Sample Data
{
"signature": {
"r": "0x34b4fe28e091111949d4925ae53c10c552e859523debcafa41048767ca88bace",
"s": "0x48ecd1cd140ecb3d91bfac13410794e5cdbf3221fcf4371a293a737ffab4b3d0",
"v": 28
},
"action": {
"type": "batchModify",
"modifies": [
{
"oid": 291708433915,
"order": {
"a": 168,
"b": false,
"p": "0.03302",
"s": "8000",
"r": false,
"t": {
"limit": {
"tif": "Alo"
}
}
}
}
]
},
"nonce": 1768146913007
}View this transaction on Hypurrscan
Field Reference
Action Fields
| Field | Type | Description |
|---|---|---|
type | string | Always "batchModify" |
modifies | array | Array of modification objects |
Modify Object Fields
| Field | Type | Description |
|---|---|---|
oid | number | Order ID of the order to modify |
order | object | New order parameters (same structure as order action) |
Order Fields
| Field | Type | Description |
|---|---|---|
a | number | Asset index |
b | boolean | Side: true for buy, false for sell |
p | string | New limit price |
s | string | New size |
r | boolean | Reduce-only flag |
t | object | Order type configuration |
Atomicity Guarantee
All modifications in a batch are executed atomically:
- All succeed: Every order is updated
- All fail: No orders are changed
This prevents scenarios where partial updates could leave a market maker with imbalanced quotes.
Use Cases
Market Making Quote Updates
Update bid and ask quotes together to maintain spread:
def process_batchModify_action(action):
modifies = action.get('modifies', [])
for mod in modifies:
oid = mod['oid']
new_price = mod['order']['p']
new_size = mod['order']['s']
side = 'BUY' if mod['order']['b'] else 'SELL'
print(f"Modified {oid}: {side} {new_size} @ {new_price}")Spread Analysis
Track how market makers adjust their quotes in response to price movements.
Quote Refresh Rate Monitoring
Measure how frequently market makers update their orders.