updated crank
This commit is contained in:
parent
b9473d67b3
commit
09eef5a0bf
27
crank.sh
27
crank.sh
|
@ -1,6 +1,5 @@
|
|||
|
||||
source ~/mango/cli/devnet.env
|
||||
solana config set --url https://devnet.solana.com
|
||||
|
||||
DEX_PROGRAM_ID=$(cat $IDS_PATH | jq .devnet.dex_program_id -r)
|
||||
|
||||
|
@ -8,36 +7,34 @@ MARKET_STR="${1^^}/${2^^}"
|
|||
|
||||
if [ $MARKET_STR = "BTC/USDT" ]; then
|
||||
MARKET=$(cat ~/mango-client-ts/src/ids.json | jq '.devnet.spot_markets|.["BTC/USDT"]' -r)
|
||||
BASE_WALLET=$(spl-token accounts --owner $KEYPAIR $BTC | tail -1 | cut -d' ' -f1)
|
||||
QUOTE_WALLET=$(spl-token accounts --owner $KEYPAIR $USDT | tail -1 | cut -d' ' -f1)
|
||||
BASE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $BTC | tail -1 | cut -d' ' -f1)
|
||||
QUOTE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $USDT | tail -1 | cut -d' ' -f1)
|
||||
elif [ $MARKET_STR = "ETH/USDT" ]; then
|
||||
MARKET=$(cat ~/mango-client-ts/src/ids.json | jq '.devnet.spot_markets|.["ETH/USDT"]' -r)
|
||||
BASE_WALLET=$(spl-token accounts --owner $KEYPAIR $ETH | tail -1 | cut -d' ' -f1)
|
||||
QUOTE_WALLET=$(spl-token accounts --owner $KEYPAIR $USDT | tail -1 | cut -d' ' -f1)
|
||||
BASE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $ETH | tail -1 | cut -d' ' -f1)
|
||||
QUOTE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $USDT | tail -1 | cut -d' ' -f1)
|
||||
elif [ $MARKET_STR = "BTC/USDC" ]; then
|
||||
MARKET=$(cat ~/mango-client-ts/src/ids.json | jq '.devnet.spot_markets|.["BTC/USDC"]' -r)
|
||||
BASE_WALLET=$(spl-token accounts --owner $KEYPAIR $BTC | tail -1 | cut -d' ' -f1)
|
||||
QUOTE_WALLET=$(spl-token accounts --owner $KEYPAIR $USDC | tail -1 | cut -d' ' -f1)
|
||||
BASE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $BTC | tail -1 | cut -d' ' -f1)
|
||||
QUOTE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $USDC | tail -1 | cut -d' ' -f1)
|
||||
|
||||
elif [ $MARKET_STR = "ETH/USDC" ]; then
|
||||
MARKET=$(cat ~/mango-client-ts/src/ids.json | jq '.devnet.spot_markets|.["ETH/USDC"]' -r)
|
||||
BASE_WALLET=$(spl-token accounts --owner $KEYPAIR $ETH | tail -1 | cut -d' ' -f1)
|
||||
QUOTE_WALLET=$(spl-token accounts --owner $KEYPAIR $USDC | tail -1 | cut -d' ' -f1)
|
||||
BASE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $ETH | tail -1 | cut -d' ' -f1)
|
||||
QUOTE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $USDC | tail -1 | cut -d' ' -f1)
|
||||
|
||||
elif [ $MARKET_STR = "BTC/WUSDT" ]; then
|
||||
MARKET=$(cat ~/mango-client-ts/src/ids.json | jq '.devnet.spot_markets|.["BTC/WUSDT"]' -r)
|
||||
|
||||
BASE_WALLET=$(spl-token accounts --owner $KEYPAIR $BTC | tail -1 | cut -d' ' -f1)
|
||||
QUOTE_WALLET=$(spl-token accounts --owner $KEYPAIR $WUSDT | tail -1 | cut -d' ' -f1)
|
||||
BASE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $BTC | tail -1 | cut -d' ' -f1)
|
||||
QUOTE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $WUSDT | tail -1 | cut -d' ' -f1)
|
||||
elif [ $MARKET_STR = "ETH/WUSDT" ]; then
|
||||
MARKET=$(cat ~/mango-client-ts/src/ids.json | jq '.devnet.spot_markets|.["ETH/WUSDT"]' -r)
|
||||
BASE_WALLET=$(spl-token accounts --owner $KEYPAIR $ETH | tail -1 | cut -d' ' -f1)
|
||||
QUOTE_WALLET=$(spl-token accounts --owner $KEYPAIR $WUSDT | tail -1 | cut -d' ' -f1)
|
||||
BASE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $ETH | tail -1 | cut -d' ' -f1)
|
||||
QUOTE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $WUSDT | tail -1 | cut -d' ' -f1)
|
||||
else
|
||||
echo "invalid args"
|
||||
fi
|
||||
solana config set --url https://api.mainnet-beta.solana.com
|
||||
|
||||
|
||||
pushd ~/blockworks-foundation/serum-dex/dex/crank || exit
|
||||
cargo run -- $CLUSTER consume-events --dex-program-id $DEX_PROGRAM_ID --payer $KEYPAIR --market $MARKET --coin-wallet $BASE_WALLET --pc-wallet $QUOTE_WALLET --num-workers 1 --events-per-worker 5 --log-directory .
|
||||
|
|
Loading…
Reference in New Issue