From ec3376f67085529d160c35b59b0f68d85b9ea429 Mon Sep 17 00:00:00 2001 From: olli Date: Sat, 24 Jun 2023 14:36:03 +0200 Subject: [PATCH] compare Trading and Convert price and use the cheaper variant - nicer output --- dabo/functions/binance_convert.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dabo/functions/binance_convert.sh b/dabo/functions/binance_convert.sh index 7411f0e..9f7ad90 100644 --- a/dabo/functions/binance_convert.sh +++ b/dabo/functions/binance_convert.sh @@ -27,7 +27,7 @@ function binance_convert { # get trade commission for comparison with convert binance-api-call GET /sapi/v1/asset/tradeFee "&symbol=${f_ASSET}${f_CURRENCY}" - local FEE=$(echo "$(cat $g_tmp/API_CMD_OUT | jq -r .[].takerCommission)*100" | bc -l) + local FEE=$(echo "$(cat $g_tmp/API_CMD_OUT | jq -r .[].takerCommission)*100" | bc -l | sed 's/^\./0./; s/^-\./-0./') if [ "${f_ACTION}" = "buy" ] then @@ -64,7 +64,7 @@ ${FUNCNAME} $@" if [ $(echo "${f_price_diff} > ${FEE}" | bc -l) -eq 1 ] then - local f_note="Price difference between Market Price (${f_market_price}) and Binance Convert Price (${f_convert_price}) is higher then Trading Fee (${f_price_diff} > ${FEE}), so I will better use trade then convert" + local f_note="Price difference between Market Price (${f_market_price} ${f_CURRENCY}) and Binance Convert Price (${f_convert_price} ${f_CURRENCY}) is higher then Trading Fee (${f_price_diff}% > ${FEE}%), so I will better use trade then convert" g_echo_note "$f_note" g_signal-notify "$f_note" return 1