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.
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
- Spot: you sent more decimals than lotSz allows (for DOGE-USDT lotSz is 0.000001 in our data, for BTC-USDT 0.00000001).
- Swap or futures: you sent a coin amount where OKX wants contracts. One BTC-USDT-SWAP contract is 0.01 BTC.
- A size computed from percentages or leverage was not rounded to lotSz.
How to fix it
- Call /api/v5/public/instruments for your instType and instId; read lotSz, minSz and (for derivatives) ctVal.
- For swaps convert coins to contracts: contracts = coins / ctVal.
- Round the size DOWN to a multiple of lotSz.
- 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
| Symbol | Price step (tick) | Quantity step | Minimum quantity | Source and read date |
|---|---|---|---|---|
| OKX BTC-USDT | 0.1 | 0.00000001 | 0.00001 | www.okx.com, read 2026-11-11 |
| OKX ETH-USDT | 0.01 | 0.000001 | 0.0001 | www.okx.com, read 2026-11-11 |
| OKX SOL-USDT | 0.01 | 0.000001 | 0.01 | www.okx.com, read 2026-11-11 |
| OKX XRP-USDT | 0.0001 | 0.000001 | 1 | www.okx.com, read 2026-11-11 |
| OKX DOGE-USDT | 0.00001 | 0.000001 | 10 | www.okx.com, read 2026-11-11 |
| OKX BTC-USDT-SWAP (swap, contracts) (1 contract = 0.01 coins) | 0.1 | 0.01 | 0.01 | www.okx.com, read 2026-11-11 |
| OKX ETH-USDT-SWAP (swap, contracts) (1 contract = 0.1 coins) | 0.01 | 0.01 | 0.01 | www.okx.com, read 2026-11-11 |
| OKX SOL-USDT-SWAP (swap, contracts) (1 contract = 1 coins) | 0.01 | 0.01 | 0.01 | www.okx.com, read 2026-11-11 |
| OKX XRP-USDT-SWAP (swap, contracts) (1 contract = 100 coins) | 0.0001 | 0.01 | 0.01 | www.okx.com, read 2026-11-11 |
| OKX DOGE-USDT-SWAP (swap, contracts) (1 contract = 1000 coins) | 0.00001 | 0.01 | 0.01 | www.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
- https://www.okx.com/docs-v5/en/ (read 2026-11-16)
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.
Related fixes
- Your order should meet or exceed the minimum order amount. (OKX spot and swap)
- Filter failure: LOT_SIZE (Binance spot)
- Filter failure: NOTIONAL (Binance spot)
All error fixes. General information for education only. It is not financial advice, and trading can lose money.