From f03876f87500694c77af11a926cc6f9f6f0e331f Mon Sep 17 00:00:00 2001 From: Wolf Date: Tue, 3 Aug 2021 17:04:41 +0200 Subject: [PATCH] ommit api call (#11) --- commands/stack.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/commands/stack.js b/commands/stack.js index 552ea42..136e43a 100644 --- a/commands/stack.js +++ b/commands/stack.js @@ -38,6 +38,11 @@ module.exports = async (kraken, validate, { getEnv, getEnvOpt }) => { console.log('📈 Ask:', ask, fiat) console.log('📉 Bid:', bid, fiat, '\n') + if (parseFloat(fiatBalance) < parseFloat(amount)) { + console.log('❌ Insufficient funds') + return + } + // Place order const details = { pair, type: 'buy', ordertype, price, volume } if (validate) details.validate = true