Order quantity must be a multiple of the lot size.

OKX error 51121 means the size (sz) you sent is not an exact multiple of the instrument's lot size (lotSz). On spot the size is in coins, for the swaps in the table it is in contracts.

Official docs opened 2026-11-16. OKX error 51121. Plain-English guide, not financial advice.

What the official docs say

OKX API docs, error codes: "51121 - Order quantity must be a multiple of the lot size." Instrument limits (lotSz, minSz, tickSz) come from /api/v5/public/instruments.

Three common causes

  1. Spot: you sent more decimals than lotSz allows (for DOGE-USDT lotSz is 0.000001 in our data, for BTC-USDT 0.00000001).
  2. Swap or futures: you sent a coin amount where OKX wants contracts. One BTC-USDT-SWAP contract is 0.01 BTC.
  3. A size computed from percentages or leverage was not rounded to lotSz.

How to fix it

  1. Call /api/v5/public/instruments for your instType and instId; read lotSz, minSz and (for derivatives) ctVal.
  2. For swaps convert coins to contracts: contracts = coins / ctVal.
  3. Round the size DOWN to a multiple of lotSz.
  4. Make sure it is at least minSz, then send sz as a string.

Python (standard library only) example (runs as shown with sample numbers):

from decimal import Decimal, ROUND_DOWN

def floor_to_step(value, step):
    v, s = Decimal(str(value)), Decimal(str(step))
    return (v / s).to_integral_value(ROUND_DOWN) * s

# BTC-USDT-SWAP: ctVal 0.01 BTC per contract, lotSz 0.01, minSz 0.01
coins = "0.0537"
contracts = floor_to_step(Decimal(coins) / Decimal("0.01"), "0.01")
print(contracts)

Current limits for popular symbols

SymbolPrice step (tick)Quantity stepMinimum quantitySource and read date
OKX BTC-USDT0.10.000000010.00001www.okx.com, read 2026-11-11
OKX ETH-USDT0.010.0000010.0001www.okx.com, read 2026-11-11
OKX SOL-USDT0.010.0000010.01www.okx.com, read 2026-11-11
OKX XRP-USDT0.00010.0000011www.okx.com, read 2026-11-11
OKX DOGE-USDT0.000010.00000110www.okx.com, read 2026-11-11
OKX BTC-USDT-SWAP (swap, contracts) (1 contract = 0.01 coins)0.10.010.01www.okx.com, read 2026-11-11
OKX ETH-USDT-SWAP (swap, contracts) (1 contract = 0.1 coins)0.010.010.01www.okx.com, read 2026-11-11
OKX SOL-USDT-SWAP (swap, contracts) (1 contract = 1 coins)0.010.010.01www.okx.com, read 2026-11-11
OKX XRP-USDT-SWAP (swap, contracts) (1 contract = 100 coins)0.00010.010.01www.okx.com, read 2026-11-11
OKX DOGE-USDT-SWAP (swap, contracts) (1 contract = 1000 coins)0.000010.010.01www.okx.com, read 2026-11-11

Check your numbers

Pick a symbol, type your quantity and see the valid rounded quantity.

Check this automatically before every order: AIKIT (free 1,000 calls)

Disclosure: AIKIT is our own product. It returns sourced exchange and broker rules (with the official source and read date) and checks bot code against them. Facts and checks only, not advice.

Questions people ask

What does OKX error 51121 mean?

The order size is not a multiple of the instrument's lot size (lotSz).

Is sz in coins or contracts?

On spot it is in the base coin. On swaps and futures it is in contracts; multiply by ctVal to get coins.

Where do I read lotSz?

In the response of /api/v5/public/instruments. The table here shows current values with the read date.

Sources

Symbol limits in the table: AIKIT facts read 2026-11-11 from the venue's own public API (links in the table). Exchange rules change; read the live values from the venue before you trade.

All error fixes. General information for education only. It is not financial advice, and trading can lose money.