Order Rounding and Step Size: Why Automated Trades Get Rejected

Automated crypto orders often get rejected because the quantity or price does not fit the exchange's rounding and step size rules. Here is how step size, tick size, and precision work, and how to round orders so they fill.

You automate a strategy, the signal fires, and the order comes back rejected. No fill, no position, just an error code to decode after the moment has passed. More often than people expect, the culprit is not your API key or your network. It is crypto order rounding and step size: the order quantity or price you sent did not line up with the exact increments the exchange allows, so it was refused.

Step size and rounding are unglamorous, but they decide whether an automated order lives or dies. Manual traders rarely notice them because the exchange's web form quietly rounds for them. Automation removes that safety net: when your bot or relay sends a raw number over the API, it has to respect the exchange's precision rules exactly, or the order bounces. This guide explains what step size, tick size, and lot size are, why they cause rejections, and how to round orders so your signals turn into fills.

What step size and tick size mean

Every trading pair on an exchange comes with a set of filters that define the legal shape of an order. Two of them matter most here.

Step size (sometimes called lot size) is the smallest increment you can change the quantity by. If BTC/USDT has a step size of 0.00001, then 0.00001, 0.00002, and 0.00003 BTC are all valid, but 0.000015 is not, because it falls between two allowed steps. The quantity has to be a whole multiple of the step size.

Tick size is the same idea applied to price. It is the smallest increment a limit price can move. If a pair has a tick size of 0.01, you can place a limit at 27000.00 or 27000.01, but not 27000.005. Market orders skip this because they do not carry a price, which is one reason market orders are simpler to automate.

Exchanges publish these values per symbol in the market metadata you can pull from the API. The takeaway: step size and tick size are not suggestions. An order that ignores them is invalid by definition, and the exchange rejects it before it ever reaches the order book.

Why automated orders get rejected

Rejections cluster around a handful of causes, and rounding sits at the center of most of them.

The first is precision overflow. Your strategy calculates a position size like 0.0333333 BTC because you divided a dollar amount by the current price. That number has more decimal places than the step size permits, so the exchange throws a filter error. A human would never type that many digits; a script produces them constantly.

The second is a price that is off-tick. You compute a limit price of 1834.567 from an indicator, but the tick size is 0.01. The exchange expects 1834.56 or 1834.57 and rejects anything in between.

The third is a quantity that rounds down to zero or below the minimum. If your sizing math produces a value smaller than one step, naive rounding can turn it into 0, and an order for nothing is invalid. This overlaps with a related rule, the minimum order size, covered in our guide on exchange minimum order sizes. Step size and minimums work together: your rounded quantity must be both a valid multiple of the step and at or above the floor.

The common thread: automation sends exact numbers, and exact numbers rarely land on legal increments by accident. Without a rounding step in your pipeline, rejection is the default, not the exception.

How to round quantity to the step size

The correct way to fit a quantity to step size is to round down to the nearest multiple of the step. Rounding down, rather than to the nearest, avoids accidentally sizing up beyond what your capital or risk math intended.

The logic is straightforward: divide your desired quantity by the step size, take the floor of that result, then multiply back by the step size. For a desired 0.0333333 BTC with a step of 0.00001, you divide to get 3333.33, floor to 3333, and multiply back to 0.03333 BTC, a clean multiple of the step that will pass the filter.

One subtlety trips up almost everyone: floating point. Computers cannot represent most decimals exactly, so 0.1 plus 0.2 is famously not quite 0.3. If you round using raw floats, you can produce a value like 0.033330000000001, which fails precision checks anyway. The fix is to work with decimal types or scaled integers, and to format the final number to exactly the decimal places the step size implies. Send "0.03333", not a float that merely looks like it.

How to round price to the tick size

Price follows the same pattern, with one judgment call. Divide the price by the tick size, round to an integer, and multiply back. Whether you round up, down, or to nearest depends on your intent: for a buy limit you often round down so you do not pay more than intended, and for a sell limit you round up for the same reason in reverse. Rounding to nearest is fine when a fraction of a tick does not matter. Pick a rule, apply it consistently, and format the result to the tick's decimal precision before sending. As with quantity, format explicitly rather than trusting a raw float that may carry phantom digits.

If you are deciding between order types in the first place, our guide on market versus limit orders in automated trading explains when a price even needs to be sent. Market orders sidestep tick size entirely, which is part of why they are the simplest place to start.

Best practices for handling rounding in automation

  • Fetch each symbol's step size, tick size, and minimums from the exchange metadata rather than hardcoding them, because they differ per pair and change over time.
  • Cache that metadata and refresh it periodically instead of pulling it on every order, so you stay fast without going stale.
  • Round quantity down to the step size, and round price to the tick size using a consistent buy or sell rule.
  • Use decimal or integer math, never raw floats, and format the final value to the precision the exchange expects.
  • Check the rounded quantity against the minimum order size and minimum notional first; if it falls short, skip the order deliberately rather than letting the exchange reject it.
  • Log the raw and rounded values together, so when an order does bounce you can see exactly what was sent.
  • Treat a rejection as data. Capturing and classifying errors is the first step to fixing them, which we cover in handling failed and rejected orders.

Where the rounding should happen

A practical question is where in your pipeline the rounding belongs. If you compute sizes inside a TradingView strategy and pass them through an alert, you can shape the numbers there, but Pine Script does not know the exchange's live filters, so it can only approximate. It is cleaner to let the layer closest to the exchange do the final rounding, since it reads the current symbol metadata and applies the exact rules. For guidance on sending the quantity itself, see how to control order size in TradingView webhook alerts.

This is exactly the kind of unglamorous correctness work a relay layer exists to handle. SignalToExchange is a non-custodial webhook relay: your signals come in from TradingView or any automation platform, and the relay submits the resulting order to your exchange using trade-only API keys, with no access to withdraw your funds. Part of reliable submission is respecting each exchange's step size, tick size, and minimums so a valid signal becomes a valid order rather than a rejection. You keep custody and control the logic; the relay handles the execution details. If you want signals executed cleanly without wiring up rounding logic yourself, request access to start your free trial.

Frequently Asked Questions

Why does my order get rejected even though I have enough balance?

Balance is only one check. If the quantity is not a valid multiple of the step size, or the limit price is off-tick, the exchange rejects the order regardless of your balance. Round quantity down to the step size and price to the tick size, and format both to the decimal precision the symbol requires.

Should I round order quantity up or down?

Round quantity down to the nearest step. Rounding down keeps you at or below your intended size, which respects your capital and risk math. Rounding up can push you into a larger position than planned, and can breach a maximum order filter on some pairs.

What is the difference between step size and minimum order size?

Step size is the increment your quantity must be a multiple of. Minimum order size is the smallest total order the exchange will accept, often expressed as a minimum quantity and a minimum notional value in the quote currency. A rounded quantity must satisfy both: it must be a clean multiple of the step and still meet the minimum.

Do market orders have tick size problems?

No. Tick size applies to a limit price, and market orders do not carry a price, so they skip that check. Market orders still have to respect step size and minimum quantity, but they avoid the off-tick rejections that limit orders hit.

Why does floating point cause rounding errors in trading bots?

Most decimal values cannot be stored exactly in binary floating point, so arithmetic can leave tiny residual digits. Those phantom digits can make an otherwise correct quantity fail a precision filter. Using decimal types or scaled integers, and formatting to the exact precision, avoids the problem.

Automated trading involves risk. SignalToExchange is execution infrastructure and does not provide financial advice, trading signals, or guarantees of any kind.

Secure Signal Routing Infrastructure

Non-custodial execution. Trade-only API keys. Independent infrastructure built for reliability.

Request Early Access

Trade-only API key enforcement. No withdrawal permissions. No custody.