get FEE dynamically fix

This commit is contained in:
olli 2023-06-23 22:05:01 +02:00
parent 2cbc884aae
commit 048dfd2a18

View File

@ -26,7 +26,7 @@ function binance_convert {
fi fi
# get trade commission for comparison with convert # get trade commission for comparison with convert
binance-api-call GET /sapi/v1/asset/tradeFee "&symbol=${f_ASSET}${f_QUANTITY}" 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)
if [ "${f_ACTION}" = "buy" ] if [ "${f_ACTION}" = "buy" ]
@ -68,6 +68,7 @@ ${FUNCNAME} $@"
g_signal-notify "$f_note" g_signal-notify "$f_note"
return 1 return 1
fi fi
g_echo_note "Price difference between Market Price (${f_market_price}) and Binance Convert Price (${f_convert_price}) is lower then Trading Fee (${f_price_diff} > ${FEE}), so I will use convert"
echo "cat ${g_tmp}/API_CMD_OUT >${f_CMDFILE}_QUOTE_OUT echo "cat ${g_tmp}/API_CMD_OUT >${f_CMDFILE}_QUOTE_OUT
local f_quoteid=\$(cat ${g_tmp}/API_CMD_OUT | jq -r '.quoteId') local f_quoteid=\$(cat ${g_tmp}/API_CMD_OUT | jq -r '.quoteId')