Skip to main content
The Bulk Order API allows a client to submit and manage multiple limit orders (both bids and asks) in a single atomic transaction. Eac account can have at most one Bulk Order per market. This API cancels all existing resting liquidity for the market provided and replaces it with the new bulk set of orders (bids and asks). Partial failures (e.g., an order that cannot be posted due to a PostOnly violation) do not revert the transaction — that particular order will simply be skipped or partially placed. Cancelled price levels and sizes will be returned explicitly in the update event. ** NOTE **
  • Bulk Order Placements with a non-increasing sequence_number will be rejected.
  • Order updates that reduce size will maintain its position in the matching queue, order updates that increase size will be moved to the end of the matching queue.
Function:
ABI Object:
Parameters:
  • signer - The account signer
  • subaccount - The Trading Account object
  • market - The PerpMarket object
  • sequence_number - The monotonically increasing number associated with this order
  • bid_prices - `vector<u64>` - Array of bid prices in chain units
  • bid_sizes - `vector<u64>` - Array of bid sizes in chain units
  • ask_prices - `vector<u64>` - Array of ask prices in chain units
  • ask_sizes - `vector<u64>` - Array of ask sizes in chain units
  • builder_address - Optional builder address `<Option<address>>`
  • builder_fees - Optional builder fee `<Option<u64>>`, in units of 0.0001% (basis points × 100; e.g. 1000 = 10 bps = 0.1%, the protocol maximum). The TypeScript SDK takes basis points and does this conversion for you

Time in Force

Bulk Orders are Post-Only limit orders.

Constraints

The transaction aborts unless all of the following hold:
  • At most 40 price levels per side
  • bid_prices strictly descending (best bid first) and ask_prices strictly ascending (best ask first)
  • The best bid is below the best ask; no zero sizes; at least one side non-empty
  • sequence_number is greater than zero and greater than the previous bulk order’s for this market; a non-increasing sequence number is rejected without aborting the transaction — a rejection event is emitted and the previous ladder stays in place, so check the event rather than the transaction status
Example: