Why an exchange rejects your order: tick, step, notional
An order to buy 0.123456 of some coin at 27,431.257 can be rejected before it reaches the order book. Exchanges define trading rules per symbol, and a client that ignores them gets an error for something that looks fine.
The filters
On Binance, the exchangeInfo endpoint returns a list of filters for every symbol. Other exchanges use different names for the same ideas. The ones you meet first:

- PRICE_FILTER: the price must be a multiple of
tickSize, and lie between the minimum and maximum price. - LOT_SIZE: the quantity must be a multiple of
stepSize, and betweenminQtyandmaxQty. - NOTIONAL (older name: MIN_NOTIONAL): price times quantity must be at least the minimum order value, and the exchange may also define a maximum.
- PERCENT_PRICE-type filters: the price may not deviate more than a set percentage from a reference price, which rejects far-away limit orders.
The failure comes back as an API error, for example code -1013 with a message starting "Filter failure". The exact names, fields and error codes are in the exchange's API documentation, and they change between spot and futures and over time, so read them from the current docs and from the live exchangeInfo, not from memory.
Why round() is wrong
Two problems occur at once. First, round(0.123456, 3) may round up, and an order to sell quantity that you do not own fails with insufficient balance. Sizes and prices that come from a calculation should be floored to the step for quantity (or rounded in the direction that is safe for you), and rounded to the tick for price. Second, floats cannot represent the steps: 0.1 or 0.001 have no exact binary form, so a check like qty % step == 0 gives wrong answers on floats.
Use Decimal built from the strings in the exchange response:
- Floor quantity to a multiple of the step:
(qty // step) * step. - After flooring, check the minimum quantity and the minimum notional again, since flooring can push you below them.
- Send the result as a string with no scientific notation.
str(Decimal('0.0000100'))can turn into1.00E-5, so format withformat(value, 'f').
Cache, but refresh
Filters change: exchanges adjust tick sizes and minimums when prices move by a large factor. Cache exchangeInfo for a while, refresh it periodically and on rejection, and treat a new filter failure as a reason to reload before you retry, not as a reason to retry blindly in a loop.
Testing
A unit test with a few made-up symbols covers most of the trouble: a step of 0.001, a tick of 0.01, an amount with many digits, and a value that lands just under the minimum notional after flooring. It is cheaper than finding out through rejected orders in production, which usually happens at the moment the market is moving.
Testnet filters are not the same as production filters
A bot developed and tested against an exchange's testnet or sandbox environment can pass every test and still fail its first real order in production, because testnet symbols commonly have different tick sizes, step sizes and minimum notional values than their production counterparts, set independently by whoever maintains the test environment rather than mirrored automatically from live trading rules. Code that hardcodes filter values discovered once during testnet development, rather than reading them fresh from exchangeInfo (or the equivalent) against whichever environment it is actually pointed at, inherits this mismatch silently the moment it is pointed at production for the first time. The caching advice already given, treat exchangeInfo as something to fetch and refresh rather than a constant baked into the code, is the same discipline that protects against this specific version of the problem: read the filters from the environment you are actually trading in, every time, rather than from what testnet reported during development.