placeorders: use python to check offer size

This commit is contained in:
nahuhh 2024-11-10 12:05:36 +00:00
parent 98da79699c
commit 0255ac8bc6

View file

@ -1,7 +1,7 @@
#!/bin/bash
############################
###########################
#set -x
set -x
PORT=12700 # BasicSwapDex http port
# config file location
@ -295,9 +295,10 @@ check_bids() {
revert_config
apply_config
FOUNDBID=$(python3 createoffers.py --configfile $taker --statefile $state --port=$PORT --oneshot --debug | grep "New bid")
POSTOFFER=$(python3 -c "print($OB_AMOUNT < $OB_MIN)")
if [[ $FOUNDBID ]]; then
$grn"Placed bid successfully! Check BasicSwapDEX to confirm\n";$nc
elif [[ $OB_AMOUNT < $OB_MIN && -z $FOUNDBID ]]; then
elif [[ $POSTOFFER == True ]] && [[ -z $FOUNDBID ]]; then
printf "Checking for a matching offer\n"
printf "No matching offers found $red2:@ !!!$nc2\nBid quantity too$red2 low$nc2 to post to order book.\nTrying again in 30 seconds\n"
sleep 30