Reserving Funds for Market Buy Orders with Unknown Execution Prices
Summary
The document examines how an exchange or trading platform should reserve a user’s funds before submitting an order. For limit buys, the limit price and quantity give a known quote-currency amount; for sells, the base-currency quantity is known. A market buy is harder because its execution price depends on the order book and is unknown at submission time.
Using the last traded price to estimate the debit can leave the account underfunded if the market buy executes at a higher price. The text points out that a fixed buffer, such as a percentage above the last price, cannot guarantee that the account will avoid a negative balance. It frames the issue as a practical balance-control question but gives no resolution, implementation, or comparison of alternatives. The discussion is limited to the risk of estimating a market buy’s cost before execution; it does not address order-book depth, slippage controls, or other reservation mechanisms.
Key ideas
- A limit buy’s reserved quote amount can be estimated from its limit price and quantity.
- A market sell’s required base amount is known from its quantity.
- A market buy’s eventual cost is unknown before it interacts with the order book.
- Reserving funds using the last price can leave a shortfall if execution occurs at a higher price.
- A fixed price buffer cannot guarantee that the account will remain funded.
Tags
Full text
# How to debit user balance on market buy order? # How to debit user balance on market buy order? Suppose that the user's balance is debited before his order is sent to the matching engine. The debiting is done to ensure that the user has sufficient balance and that he is not submitting orders that he ultimately cannot afford. For limit orders, the amount to be debited is trivial to estimate. ``` Debit(Limit buy) = price * qty (quote asset) Debit(Limit sell) = qty (base asset) ``` For market sell orders, the amount to be debited is also trivially estimated: ``` Debit(Market sell) = qty (base asset) ``` How about market buy orders, however? The price is not known before the order hits the book, so you cannot do ``` Debit(Market buy) = price * qty (quote asset) ``` You could do last price instead: ``` Debit(Market buy) = last price * qty (quote asset) ``` And then, once you know the actual price at execution, debit or credit an additional amount to make up the difference. But what if `last price < actual price` ? Then the user's balance will potentially become negative. Of course you could require a buffer (e.g. 150% of the last price) to account for this but there is no guarantee that this buffer will be sufficient for preventing negative balance. Am I missing something obvious here?
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.