hello.
Is it necessary that the user's usdt balance is a slightly higher than the amount for the trade to take place in .marketBuy function?
Is the transaction definitely done without the buffer amount?
amount = 0.2
price = binance.prices('BTCUSDT')
total = price * amount
const buffer = 2; // set a buffer of 2 usdt
if (balance < total + buffer) {
console.error('Insufficient USDT balance');
return;
}
else{
binance.marketBuy('BNBBTC', amount)
}
Reactions are currently unavailable
hello.
Is it necessary that the user's usdt balance is a slightly higher than the amount for the trade to take place in .marketBuy function?
Is the transaction definitely done without the buffer amount?
amount = 0.2 price = binance.prices('BTCUSDT') total = price * amount const buffer = 2; // set a buffer of 2 usdt if (balance < total + buffer) { console.error('Insufficient USDT balance'); return; } else{ binance.marketBuy('BNBBTC', amount) }