binance-api-node icon indicating copy to clipboard operation
binance-api-node copied to clipboard

quoteOrderQty parameter buying by Market

Open shadal3 opened this issue 3 years ago • 2 comments

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.

shadal3 avatar Mar 16 '21 14:03 shadal3

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.

hp8wvvvgnj6asjm7 avatar Mar 26 '21 10:03 hp8wvvvgnj6asjm7

quoteOrderQty = '100%' is correct ?

denernun avatar Apr 16 '21 16:04 denernun