Beginner's Guide to QuoteOrderQty Market Orders

QuoteOrderQty Market orders is a feature currently only supported by the Binance API for SPOT orders.

To explain how it works and give example use cases, let’s review some finance terms.

A symbol is composed of a base asset and a quote asset.
Given a symbol BTCUSDT, BTC stands for the base asset and USDT stands for the quote asset.

One way to think about this is “How much USDT do I need to have in order to get an amount of BTC?”

MARKET orders
A regular MARKET order is when you buy or sell your base asset for the current market price. In the API, this would be using the parameter quantity.

Let’s say, the market price for 1 BTC is 10,900 USDT.

If you want to buy 1 BTC, you can send a MARKET order on the BUY side for 1 BTC and you will spend your 10,900 USDT.

If you want to sell 1 BTC, you can send a MARKET order on the sell side for 1 BTC and you will receive 10,900 USDT.

The reverse:

But what if, you have 100 USDT, and you want to spend all of it for the correct amount of BTC? In a regular market order, you would have to guess how much of the quantity (BTC) in the order. This could lead to either insufficient funds (because the quantity was too high) or leftover USDT (because the quantity was too low).

This is where the field quoteOrderQty MARKET orders come in.

If you want to spend 100 USDT to get some BTC, you can send a MARKET quoteQtyOrder of 100 USDT on the BUY side.
If you want to receive 100 USDT but don’t know how much BTC to set, you can instead send a MARKET quoteQtyOrder of 100 USDT on the SELL side.

Summary:

Market Orders using quantity, is when you want to buy or sell a specific amount of the base asset.

Market Orders using quoteOrderQty is when you want to spend or receive a specific amount of the quote asset.

Questions?
Please leave a comment if something is still unclear.

Thank you!

Excellent explanation, I had my doubts about how to use that parameter and what I was doing was obtaining the price and multiplying it by the quote asset but with this explanation you have saved me a lot of work

Taking your explanation as an example there is some way to apply the quoteQty with loans, that is, for example if I have 100 USDT to borrow that amount in BTC

@Saratoga quoteQty is not available from margin borrow endpoint yet, the work around could be calculating the amount in the client side.