Sub topic 10
Post-only orders
This chapter assumes you know what a limit order is, how the order book is organized into bids and asks, and the maker/taker fee split from the earlier chapters. You should also be able to read short Python functions.
What a post-only order is
A post-only order is a limit order with one extra rule: it must go onto the order book as a resting order, or it must not trade at all. It can never take liquidity. If the exchange would have to match it against an existing order on arrival, it refuses to do that.
A normal limit order has two possible outcomes on arrival. If its price crosses the spread, it fills immediately as a taker. If it does not cross, it rests as a maker. A post-only order removes the first outcome, so you are guaranteed to be a maker or to have no order.
The reason to use one is cost control. The previous chapter showed that makers usually pay a lower fee than takers, and some exchanges pay makers a rebate. A post-only order lets you ask for the maker rate without risking an accidental taker fill.
When a limit order becomes a taker by accident
A limit buy is marketable if its price is at or above the best ask. A limit sell is marketable if its price is at or below the best bid. A marketable order executes on arrival, even if you meant to wait.
This happens more often than you might expect:
- The book moves between the moment you read it and the moment your order arrives. Your price was below the best ask, but the ask dropped.
- You mistype a price, or use a price from a stale chart.
- A bot reprices orders quickly, and the market changes underneath it.
- The spread is one tick wide, so there is almost no room between resting and crossing.
In each case you pay the taker fee, and you may also walk the book and take slippage. A post-only flag turns all of these into a controlled outcome.
What the exchange does with a crossing order
The exchange checks the order against the book before any matching happens. If the order would cross, it applies one of two policies. Which one you get depends on the exchange and sometimes on a setting you choose.
| Policy | What happens to a crossing post-only order | Typical name |
|---|---|---|
| Reject | The order is cancelled or refused. Nothing rests and nothing fills. | Post-only, reject, or cancel |
| Slide | The price is adjusted to one tick away from the opposite best price, so the order rests as the best bid or ask. | Post-only slide, or best-price adjust |
Reject is the more common default. Slide keeps you in the book but changes your price without asking you, which matters if your plan depended on a specific level. Read the exchange's order documentation for the exact behavior. Names, defaults, and error codes differ between venues.
Modeling the check in Python
This function models the entry check for a post-only buy. It takes the best ask, your limit price, the tick size (the smallest allowed price step), and a policy.
def submit_post_only_buy(best_ask, limit_price, tick, policy="reject"):
"""Return (status, resting_price) for a post-only buy."""
if limit_price < best_ask:
return "resting", limit_price
if policy == "reject":
return "rejected", None
if policy == "slide":
return "resting", round(best_ask - tick, 8)
raise ValueError("unknown policy")
best_ask = 100.5
tick = 0.5
print(submit_post_only_buy(best_ask, 100.0, tick)) # ('resting', 100.0)
print(submit_post_only_buy(best_ask, 100.5, tick)) # ('rejected', None)
print(submit_post_only_buy(best_ask, 101.0, tick, "slide")) # ('resting', 100.0)A buy at 100.5 equals the best ask, so it would match. That is why the second call is rejected: the check is "strictly below the best ask", not "at or below". The third call asks for 101.0, which would cross. Under the slide policy it is moved to 100.0, one tick below the best ask.
The sell side mirrors this. A post-only sell must be priced strictly above the best bid.
The fee saving, with numbers
Take the made-up rates from the fees chapter: 0.20% taker and 0.10% maker. You want to buy 1 unit while the best bid is 100.0 and the best ask is 100.5.
TAKER_RATE = 0.0020
MAKER_RATE = 0.0010
def all_in_buy_cost(price, qty, rate):
return price * qty * (1 + rate)
cross_now = all_in_buy_cost(100.5, 1.0, TAKER_RATE) # take the ask
rest_bid = all_in_buy_cost(100.0, 1.0, MAKER_RATE) # post-only at the best bid
print(round(cross_now, 3)) # 100.701
print(round(rest_bid, 3)) # 100.1
print(round(cross_now - rest_bid, 3)) # 0.601The saving of 0.601 per unit has two parts. About 0.5 comes from the price: you bought at the bid instead of paying the spread. About 0.1 comes from the fee difference. The post-only flag does not create the price improvement, since any resting limit order has it. What the flag adds is the guarantee that you only get this outcome and never the 100.701 one.
You pay for this with fill uncertainty. A resting bid fills only if sellers come to you. If the price runs away upward, you saved nothing and bought nothing.
Time in force and post-only
Post-only is a property about how the order enters the book. Time in force is a property about how long it stays. They interact, and some combinations are invalid.
- Post-only with GTC (good till cancelled) is the standard combination. The order rests until it fills or you cancel it.
- Post-only with IOC (immediate or cancel) or FOK (fill or kill) contradicts itself. IOC and FOK exist to execute immediately, while post-only forbids immediate execution. Exchanges either reject this combination or ignore one of the flags.
- Some exchanges also offer a good-till-date option. Post-only works with it the same way as with GTC.
Check the validation rules before building an order form or bot. An exchange that silently drops the post-only flag would give you taker fills you were trying to avoid.
After the order rests
Post-only is checked once, at entry. After that the order is an ordinary resting limit order:
- It keeps its place in the queue under price-time priority. A post-only order at 100.0 sits behind earlier orders at 100.0.
- If an incoming market sell arrives, your order fills as a maker, possibly partially.
- It cannot later become a taker. A resting order is always the passive side of a match.
- If you amend its price, the exchange treats the amendment like a new entry. The post-only check runs again, and you usually lose your queue position.
Queue position matters because being a maker at the best price is not enough. If 50 units are ahead of you at that price, those fill first.
Failure modes and trade-offs
Post-only protects against one kind of mistake and creates others.
- Missed trades. In a fast market, your passive price may never be reached. If the goal is to be in a position, a rejected or unfilled order can be worse than paying the taker fee.
- Rejection loops. A bot that resubmits at the best price every time it is rejected can generate a stream of rejections. Exchanges rate-limit order traffic, so you may hit limits.
- Adverse selection. A resting order tends to fill when the price is moving against you. A buy at the bid fills most reliably when sellers are pushing the price down.
- Slide surprises. Under the slide policy, your order may rest at a price different from the one you typed. Read the response to find the actual price.
- Stop orders. Some exchanges do not allow post-only on stop-limit orders, or apply the check only when the stop triggers and the limit order is placed. Verify this before relying on it.
- Thin books. With a wide spread, resting inside it gives a good price but may take a long time to fill.
Choosing post-only
Use post-only when all of these are true:
- You do not need execution right now.
- The fee difference matters at your trade size or trade frequency.
- You would rather have no trade than a taker trade.
Skip it when you must exit a position quickly, such as a protective sell in a falling market, or when the fee difference is small compared with the cost of not being filled.
Exercise
The best bid is 250.0, the best ask is 250.2, and the tick size is 0.1. You submit a post-only sell at 250.0. What happens under the reject policy, and what happens under the slide policy?
Show answer
A sell must be priced strictly above the best bid to rest. At 250.0 it would match the best bid, so it crosses. Under reject, the order is cancelled and nothing trades. Under slide, the price moves one tick above the best bid, to 250.1, and the order rests there as a maker, inside the spread and below the best ask of 250.2.
Exercise
Using a taker rate of 0.20% and a maker rate of 0.10%, you want to sell 3 units. The best bid is 80.0 and the best ask is 80.4. Compute the proceeds after fees for a market sell at the bid and for a post-only sell at the best ask, assuming the post-only order fills fully. Why might the second still be the worse choice?
Show answer
Market sell at the bid: 80.0 × 3 × (1 − 0.002) = 239.52. Post-only sell at the ask, which fills as a maker: 80.4 × 3 × (1 − 0.001) = 240.9588, about 241.0. That is about 1.44 more. It can still be worse because the post-only order may never fill if the price falls away from 80.4, leaving you holding the asset after a drop. The market sell gives certainty of execution at the cost of the spread and the higher fee.
Exercise
A developer sends a post-only order with time in force set to IOC. Why is this combination a problem?
Show answer
IOC means fill whatever is possible immediately and cancel the rest. Post-only means never execute on arrival, only rest. The two rules conflict: an order that cannot rest and cannot trade on arrival has no valid outcome. Exchanges typically reject the order or ignore one flag, so the developer should use GTC (or good-till-date) with post-only.