binance-api-node
binance-api-node copied to clipboard
quoteOrderQty parameter buying by Market
Hey, from documentation I grasped that I can use only quantity parameter to buy by market, but is there a way to buy by quoteOrderQty parameter? I have not managed to find this implementation in code.
you can use this param, it's only missing in the documentation.
const requires = ['symbol', 'side']
if (!(newPayload.type === 'MARKET' && newPayload.quoteOrderQty)) {
requires.push('quantity')
}
MARKET orders using the quantity field specifies the amount of the base asset the user wants to buy or sell at the market price. E.g. MARKET order on BTCUSDT will specify how much BTC the user is buying or selling.
MARKET orders using quoteOrderQty specifies the amount the user wants to spend (when buying) or receive (when selling) the quote asset; the correct quantity will be determined based on the market liquidity and quoteOrderQty. E.g. Using the symbol BTCUSDT: BUY side, the order will buy as many BTC as quoteOrderQty USDT can. SELL side, the order will sell as much BTC needed to receive quoteOrderQty USDT.
quoteOrderQty = '100%' is correct ?