Skip to content

Exchange mechanics

Why a large market order is rejected: market order size limits by exchange

Updated Ninja Terminal team

Short answer

Every exchange caps the size of a single market order, and a larger order is rejected. OKX uses maxMktSz (error 51202), Binance uses the MARKET_LOT_SIZE filter maxQty (error -4005), Bybit uses maxMktOrderQty, and Hyperliquid caps market order value by the asset's maximum leverage. To trade more, split the order into several smaller ones.

A market order takes liquidity from the order book at once. Exchanges limit how much one order can take. The limit is set per instrument and can change when the exchange updates risk parameters. If your close is larger than the cap, the exchange rejects it. Closing a large position is where traders hit this most often.

What is the market order limit on each exchange?

Exchange Where the limit lives Unit Rejection
OKX maxMktSz in instrument data Contracts for futures and swaps. USDT amount for spot and margin 51202 “Market order amount exceeds the maximum amount.”
Binance MARKET_LOT_SIZE filter, field maxQty Base quantity -4005 QTY_GREATER_THAN_MAX_QTY
Bybit lotSizeFilter.maxMktOrderQty (linear and inverse), maxMarketOrderQty (spot) Base quantity Order rejected
Hyperliquid Contract specifications Order value in USD, based on max leverage Order rejected

OKX

The instruments endpoint returns maxMktSz. For a derivatives contract the value is a number of contracts. For SPOT and MARGIN it is a quantity in USDT, which is easy to misread as base coin. OKX also publishes maxMktAmt, a maximum USD amount for a single market order on spot and margin. Error 51201 (“The value of a market order can’t exceed {param0}”) is the related value check.

Binance

Binance has two quantity filters. LOT_SIZE applies to limit orders and MARKET_LOT_SIZE applies only to MARKET orders. Each has minQty, maxQty and stepSize. The two maxQty values can differ, so an order that works as a limit order can still fail as a market order. Read both from exchangeInfo for the symbol.

Bybit

For linear and inverse contracts, lotSizeFilter.maxMktOrderQty is the maximum quantity for a market order, and maxOrderQty is the limit and post-only maximum. Spot uses maxMarketOrderQty and maxLimitOrderQty. The Bybit create-order documentation adds one useful rule: if reduceOnly=true and the quantity is above the maximum order quantity, the order is split into several orders automatically.

Hyperliquid

Hyperliquid caps the value of a market order by the asset’s maximum leverage:

Max leverage Max market order value
25x or more $30,000,000
20x up to 25x $5,000,000
10x up to 20x $2,000,000
Below 10x $500,000

The maximum limit order value is 10 times the market order value for the same tier.

How do I get a large order through?

  1. Read the market cap for the instrument (maxMktSz, MARKET_LOT_SIZE, maxMktOrderQty, or the Hyperliquid tier).
  2. Split the total into parts at or below the cap, rounded to the instrument’s step size.
  3. Send the parts together when the exchange has a batch endpoint. Binance POST /fapi/v1/batchOrders takes up to 5 orders per request and processes them concurrently, so the fill order is not guaranteed.
  4. Keep reduceOnly on closing orders so a rounding error cannot open a position in the other direction.
  5. Check the result of every part. A batch can partly succeed.

Limit orders have their own caps (maxLmtSz on OKX, LOT_SIZE on Binance, ten times the market value on Hyperliquid), so working a position out with limit orders is another route.

How Ninja Terminal handles this

Ninja Terminal plans the split before it sends the order, so the exchange never sees an order it must reject:

  • Binance USD-M: a market order above MARKET_LOT_SIZE goes out as one batch of smaller orders.
  • OKX swaps: a market order above maxMktSz goes out as several orders.
  • Hyperliquid: Ninja Terminal sizes each part under the value cap for the asset and sends all parts in one signed action.
  • Bybit: closing orders always carry reduceOnly, so Bybit splits them itself.

Large orders still move the price. Review slippage risk and depth before you send size. This guide is not investment advice.

Frequently asked questions

What does OKX error 51202 mean?

Error 51202 reads "Market order amount exceeds the maximum amount." The order is larger than the instrument's maxMktSz. For swaps maxMktSz counts contracts. For spot it is an amount in USDT.

What does Binance error -4005 mean?

Error -4005 (QTY_GREATER_THAN_MAX_QTY) means the quantity is above the maximum. For a market order the limit is maxQty in the symbol's MARKET_LOT_SIZE filter. Limit orders use the LOT_SIZE filter.

Is the market order cap the same as my position limit?

No. The cap applies to one order. Position limits, risk limits and your available margin are separate checks, so a large order can fail on any of them.

Is splitting a large market order risky?

Splitting is how most traders get a large order through, but later parts can fill at worse prices if the book thins out. Check order book depth before you send size.

Sources

  1. OKX API v5 — Get instruments (maxMktSz, maxMktAmt)
  2. OKX API v5 — Trade error codes (51201, 51202)
  3. Binance — Filters (LOT_SIZE, MARKET_LOT_SIZE)
  4. Binance — USDⓈ-M Futures error codes
  5. Binance — Place Multiple Orders
  6. Bybit V5 — Instruments info (lotSizeFilter)
  7. Bybit V5 — Place order (reduceOnly split)
  8. Hyperliquid — Contract specifications

Trade every venue from one tab.

Binance, OKX, Bybit, and Hyperliquid with news, charts, and one-command orders. Included with Ninja Squad Pro membership.