eventEmitter.on('enter-short', async () => {
console.log(
enter-short
)
if (information.amount === 0) return;
await binance.futuresExchangeInfo();
console.log(
enter-short: вход разрешен.
)
binance.balance(async (error, balances) => {
if (error) return console.error(error);
if (balances.BTC.available >= information.amount) {
binance.futuresMarketBuy(information.symbol, information.amount);
console.info(await binance.futuresMarginType(information.symbol, 'ISOLATED'));
console.info(await binance.futuresLeverage(information.symbol, information.x));
} else {
vk.api.messages.send({
user_id: information.ownerId,
message:
Баланс меньше ${information.amount}. Невозможно начать торговлю.
,
random_id: Math.random()
})
console.log(
Balance < ${information.amount}
)
}
}) // binance.balance
})