jaggedsoft / node-binance-api

Node Binance API is an asynchronous node.js library for the Binance API designed to be easy to use.
MIT License
1.58k stars 768 forks source link

Bad request error on marketSell #782

Open valeriagrazzini opened 2 years ago

valeriagrazzini commented 2 years ago

Hi, when I try to execute this example I get the response 400 bad request

ticker = 'RAREUSDT' quantity = 16

async placeSellOrder(ticker, quantity) { return new Promise((resolve, reject) => { this.binance.marketSell(ticker, quantity, (error, response) => { if(error) { console.log('ERROR', error.statusMessage, error.statusCode) reject(error) } else { console.info("Market Sell response", response); resolve(response) } }); }) }

arifw3 commented 1 year ago

There could be two reasons. First, sync your computer's date and time. Second, when placing the sell order, give it as an integer (For example, 29 XRP, not 29.96 XRP)