Decentralised News · 2027 planning edition · Evidence reviewed 23 November 2026
What Matters
One successful batch API request does not prove that every order was accepted or filled. Read item-level status and separately reconcile order-state and execution events. Keep rejected and unknown items distinct, and do not automatically re-submit or undo confirmed legs without an authorized exposure policy.
DN Alpha Thesis
The unit of risk is the individual executed leg, not the API envelope that carried its request. A decision record should preserve transport outcome, item acceptance, cumulative fills, remaining quantity and resulting position in consistent units. Where one item remains unknown, the financial exposure remains a range, not a false zero.
DN Batch Acknowledgment and Fill Ledger
Enter normalized notional quantities in one comparison currency. A rejected item cannot have a confirmed fill in this model. Live or unknown items keep an explicit possible remaining execution range.
An HTTP success is not a completed multi-leg strategy
A desk submits three trading instructions in one API batch. The HTTP request succeeds. One order is accepted and filled, the second is rejected, and the third is accepted but has not filled completely. The application marks the batch as ‘done’ because the transport layer returned success. The economic strategy is not done at all.
The crucial distinction is that a batch request groups instructions for efficient submission. It does not, by itself, create one indivisible trade. Some platforms explicitly permit mixed successes, while others return per-item messages that need their own validation. An order accepted for processing can still be open, partially filled or later canceled.
In a hedge, the incomplete state is not only a data-quality issue. A missing opposite leg can leave the portfolio with more directional exposure than intended, even though every transport log is green.
OKX explicitly says batch operations are not all-or-nothing
OKX’s V5 trading API guidance documents batch placement, amendment and cancellation. Its batch section states that some individual operations can succeed while others fail in the same request. It instructs callers to inspect sCode and sMsg for each item. That is direct evidence against using one outer-level success flag as a sufficient result.
OKX’s batch order endpoint reference supports up to 20 submitted orders per request and imposes rate limits based on the number of orders. These are product and endpoint rules, not a guarantee that 20 orders will be simultaneously accepted or executed. The field returned for each instruction has to be correlated with the client or venue order identifier and the subsequent state.
An item-level rejection can be caused by a rule unrelated to the other items: balance, quantity constraints, risk limits or a product condition. A correctly processed batch response can therefore contain economically unacceptable partial work.
Bybit also separates order creation results from asynchronous order status
Bybit’s V5 Batch Place Order documentation describes two aligned lists: creation details and corresponding item-level codes/messages. It also specifies different maximum batch sizes by product family, including spot, linear/inverse derivatives and options. That detail is why a generic wrapper should not assume one universal maximum.
Its API documentation explicitly describes order-placement acknowledgement as asynchronous and directs consumers to the WebSocket order stream for confirmation. The private order channel has fields such as orderStatus, cumExecQty, leavesQty and identifiers needed to reconcile an order. Acknowledged does not mean fully filled.
A cancel request arriving near a fill can also produce order messages that reflect an already executed order. Use the ultimate reconciled order and execution state, not the last human-readable string alone, before releasing exposure in the local risk ledger.
Five layers of evidence for every item
| Layer | Meaning | Unsafe shortcut |
|---|---|---|
| Transport | The API request reached a service and returned a response | One HTTP success proves every order exists |
| Batch item | The venue accepted or rejected a particular requested instruction | A global response code overrides item errors |
| Order state | Accepted, open, canceled, rejected or terminal on the venue | Acknowledgement equals fill |
| Executions | Confirmed filled quantity and trade prices | Requested size equals position change |
| Portfolio | Actual resulting exposure after all associated events | Opposite orders must offset because their requests match |
Each layer has its own timestamp and source. A reliable system should be able to answer a narrow question: which evidence currently supports the exposure used in the next decision? Without that answer it can mistakenly hedge or liquidate against orders that were never accepted.
The original three-leg synthetic example
Assume three intended increments already normalized into one common comparison currency, CU. Leg A is a 10,000-CU buy, and a confirmed 10,000 is filled. Leg B is a 15,000-CU sell, but no authoritative final response is available, and the confirmed filled amount is zero. Leg C is a 5,000-CU buy, with 2,500 confirmed and the remaining 2,500 still open.
The confirmed signed exposure is +10,000 + 0 + 2,500 = +12,500 CU. If Leg B later fully sells 15,000 and Leg C does not fill further, the signed result is −2,500 CU. If Leg B never fills and Leg C completes, the signed result is +15,000 CU. Between those possibilities the current state is unsettled. The calculator reports the range under the entered assumptions instead of choosing one convenient endpoint.
None of these values are live positions, and the CU normalization itself must be validated for real contracts. A 10,000-CU BTC exposure and a 10,000-CU ETH exposure are not necessarily a perfect hedge even when their initial dollar magnitudes match. Basis, contract payoff, margin and price sensitivity remain separate.
An accepted order can reserve capital before filling
Batch submission can temporarily tie up available funds through accepted opening orders. Bybit’s batch documentation describes freezing the required amount for the life of an order. This can affect later items or subsequent requests even if the order has not filled. Conversely, a rejected item should not be treated as using the same opening-order reservation as an accepted one.
Do not assume releasing capacity is instantaneous after a cancellation request. The venue’s final order status is the evidence that the order no longer has the same open quantity; an independent balance check confirms whether funds were released. If an accepted item fills while a cancel is in progress, the economic exposure may increase rather than disappear.
Why idempotency matters more after a timeout
Suppose the batch request times out after reaching the venue. The client does not know which items were created. Repeating the entire body blindly can open duplicate legs. Depending on the API, client-supplied identifiers can help reconcile the intended requests with the actual venue orders. But an identifier’s existence is not itself a universal guarantee of exactly-once execution.
Store a stable internal batch ID and a distinct client ID for each requested order. Keep the outgoing request, transport response, item-level result, order stream and execution stream. After a timeout, query the authoritative status paths for each item before considering a new action. A reattempt must be an approved trading decision based on the current state, not a catch-all network retry.
Reject, unknown and canceled are different
A rejected item has an explicit negative response and no accepted order under the scope of that response. An unknown item has insufficient evidence: it may or may not have been accepted or executed. A canceled item may have been partially filled before its unexecuted remainder was removed. Combining those states into a single ‘failed’ flag loses the quantity distinction.
This is why our worksheet takes both confirmed filled notional and a selected status for each leg. The rejected status requires zero confirmed fill in the model. A terminal state can retain a partial confirmed fill with no remaining open quantity. A live-accepted or unknown state contributes potential future execution within its remaining declared request quantity. The range is a planning stress envelope, not a likelihood distribution.
A batch should have an explicit completion contract
Before using batch orders in a trading agent, define exactly what ‘complete’ means. For a rebalance, it may mean every target position is inside an allowed tolerance and all unused orders are canceled or accounted for. For a two-leg hedge, it may mean both sides have sufficient confirmed fills and the unmatched amount is below an authorized bound. For market-making orders, ‘complete’ may mean accepted resting orders, not fills; the requirement is different.
Do not pretend every venue offers an automatic rollback when a batch is partially accepted. OKX expressly says its batch operations can succeed in part. A compensating trade would itself create market and execution risks and should not happen automatically unless the strategy has explicitly authorized that response.
The audit log and incident response
- Save the exact batch endpoint, product and effective API documentation version.
- Assign stable unique client identifiers to each item; retain order intention and direction.
- Capture the outer transport result and every per-item code/message; do not collapse them.
- Reconcile accepted orders with WebSocket order-state and execution updates and the current position.
- Compute gross confirmed and net confirmed exposures in the same declared units; preserve unknown ranges.
- If a required leg is missing, follow the pre-authorized unmatched-risk policy. Do not invent an automatic rollback or duplicate retry.
The most useful output is a dated, explainable state of each order plus the exposure still not resolved. That is the difference between submitting three orders and managing one multi-leg financial objective.
Evidence and methodology
Documentary source check: 23 November 2026. The tool uses original hypothetical item states and manually normalized currency amounts. No funded test, actual batch request, order acknowledgement or execution was conducted. Live limits, endpoint fields, margin behavior, price changes, account permissions and quote units must be checked against the exact current venue specification. The range is a mathematical bound under the inputs, not a probability of filling. Corrections and effective-rule updates: press@decentralised.news.
Frequently asked questions
Does HTTP 200 mean every order in a crypto batch was accepted?
No. OKX explicitly supports partial success inside a batch, and Bybit returns per-item creation messages. Inspect item codes and authoritative order states.
Does an accepted batch order mean it has filled?
No. Bybit documents asynchronous order acknowledgment. The private order and execution streams establish cumulative fills and remaining quantity.
If one leg fails, will the exchange undo the other legs?
Do not assume so. The documented batch interfaces are not universal atomic transactions. Any compensating action needs an authorized plan and confirmed current state.
What should a bot do after a batch request times out?
Reconcile each client order ID against authoritative order/execution records before any re-submission; a timeout is not proof that no orders were created.
Does the DN worksheet connect to an exchange?
No. It uses synthetic or user-entered normalized notionals to calculate confirmed signed exposure and an unresolved range. It neither places orders nor fetches live status.
Primary sources
- OKX V5 API: Batch Operations — Explicit not-all-or-nothing behavior, per-item sCode/sMsg and cancel acknowledgment limits.
- OKX V5 API: Place Multiple Orders — 20-item batch endpoint and category-specific rate-limit rules.
- Bybit V5: Batch Place Order — Product-specific batch maximum, aligned item codes and asynchronous placement.
- Bybit V5: Private Order Stream — Order status, cumulative fills and residual quantity.
- Bybit V5: Private Execution Stream — Individual execution identifiers and fill details.




