mango-explorer/scripts/crank-market-service

16 lines
618 B
Bash
Executable File

#!/usr/bin/env bash
MARKET=${1:-BTC-PERP}
LIMIT=${2:-5}
SLEEP_TIME=${3:-5}
CLUSTER_URL=${4:-https://api.devnet.solana.com/}
printf "Running crank on market %s with a limit of %d and a sleep time of %d second(s) between cranks.\nPress Control+C to stop...\n" ${MARKET} ${LIMIT} ${SLEEP_TIME}
while :
do
if crank-market --market ${MARKET} --limit ${LIMIT} --log-level ERROR --cluster-url ${CLUSTER_URL}; then
echo "Last ${MARKET} crank action: $(date)" > /var/tmp/mango_healthcheck_crank_market_service
fi
printf "Pausing after cranking for %d seconds.\n" ${SLEEP_TIME}
sleep ${SLEEP_TIME}
done