better performance no sleep necessary

This commit is contained in:
olli 2024-03-27 22:48:38 +01:00
parent 400dfc3fb9
commit 9e918401e7
2 changed files with 5 additions and 4 deletions

View File

@ -21,12 +21,9 @@ function f_ccxt {
local f_exchange_type="swap"
[ -z "$LEVERAGE" ] && f_exchange_type="spot"
g_python "exchange = ccxt.${STOCK_EXCHANGE,,}({'apiKey': '${API_KEY}','secret': '${API_SECRET}','options': {'defaultType': '${f_exchange_type}',},})" || return 1
sleep 5
f_ccxt_initialized=true
fi
g_python_waitforoutput=1
g_python "$@" || return 1
unset f_ccxt_result
f_ccxt_result=${g_python_result[*]}

View File

@ -16,8 +16,12 @@ function get_assets {
bitpanda-api-call GET "public/v1/market-ticker" || return 1
#cat ${g_tmp}/API_CMD_OUT | jq -r '.[] | select(.state=="ACTIVE") | .instrument_code + "," + .last_price' | sed 's/_//' | grep "${CURRENCY}," | egrep -v "${TRANSFER_CURRENCY},|,0[\.][0]*$" >${f_filename}_OUT.tmp
cat ${g_tmp}/API_CMD_OUT | jq -r '.[] | .instrument_code + "," + .last_price' | sed 's/_//' | grep "${CURRENCY}," | egrep -v "${TRANSFER_CURRENCY},|,0[\.][0]*$" >${f_filename}_OUT.tmp
else
elif [ ${STOCK_EXCHANGE} = "NONE" ]
then
f_no_exchange=1
else
#f_ccxt "print(exchange.fetch_tickers())" && echo $f_ccxt_result >CCXT_TICKERS
return 0
fi
cat ${g_tmp}/API_CMD_OUT >PRICETICKER