diff --git a/buy b/buy index 4420e8f..242da0a 100755 --- a/buy +++ b/buy @@ -2,8 +2,8 @@ # # Automatically sets a buy order with miner and dex fees calculated # -# Usage: ./buy kmd btc 10000 1 -# (Tries to buy 1 KMD at a price of 10000 KMD/BTC) +# Usage: ./buy kmd btc-segwit 10000 1 +# (Tries to buy 1 KMD at a price of 10000 KMD/BTC-segwit) # # @author webworker01 # @see https://developers.atomicdex.io/basic-docs/atomicdex-api-legacy/buy.html diff --git a/mpm_config b/mpm_config index 91081a9..4be669b 100755 --- a/mpm_config +++ b/mpm_config @@ -6,14 +6,14 @@ # @link https://github.com/cipig/mmtools # if [[ -z $1 ]]; then - echo "You must specify a base coin to configure. (BTC, KMD, BCH, LTC, or DOGE)" + echo "You must specify a base coin to configure. (BTC-segwit, KMD, BCH, LTC-segwit, or DOGE)" echo "" echo "./mpm_config KMD" exit 0 fi -if [[ $1 == "BTC" ]] || [[ $1 == "KMD" ]] || [[ $1 == "BCH" ]] || [[ $1 == "LTC" ]] || [[ $1 == "DOGE" ]]; then +if [[ $1 == "BTC-segwit" ]] || [[ $1 == "KMD" ]] || [[ $1 == "BCH" ]] || [[ $1 == "LTC-segwit" ]] || [[ $1 == "DOGE" ]]; then nano mpm/mpm.conf.dex.$1 else - echo "Choose from BTC, KMD, BCH, LTC or DOGE." + echo "Choose from BTC-segwit, KMD, BCH, LTC-segwit or DOGE." fi diff --git a/mpm_start b/mpm_start index 1f4c457..7c454e1 100755 --- a/mpm_start +++ b/mpm_start @@ -9,22 +9,22 @@ scriptpath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" source $scriptpath/main if [[ -z $1 ]]; then - echo "You must specify a base coin. (BTC, KMD, BCH, LTC, or DOGE)" + echo "You must specify a base coin. (BTC-segwit, KMD, BCH, LTC-segwit, or DOGE)" echo "" echo "./mpm_start KMD" exit 0 fi -if [[ $1 == "BTC" ]]; then - stdbuf -oL nohup ~/mmtools/mpm_run BTC bitcoin > $mmtoolslogfile & +if [[ $1 == "BTC-segwit" ]]; then + stdbuf -oL nohup ~/mmtools/mpm_run BTC-segwit bitcoin > $mmtoolslogfile & elif [[ $1 == "KMD" ]]; then stdbuf -oL nohup ~/mmtools/mpm_run KMD komodo > $mmtoolslogfile & elif [[ $1 == "BCH" ]]; then stdbuf -oL nohup ~/mmtools/mpm_run BCH bitcoin-cash > $mmtoolslogfile & -elif [[ $1 == "LTC" ]]; then - stdbuf -oL nohup ~/mmtools/mpm_run LTC litecoin > $mmtoolslogfile & +elif [[ $1 == "LTC-segwit" ]]; then + stdbuf -oL nohup ~/mmtools/mpm_run LTC-segwit litecoin > $mmtoolslogfile & elif [[ $1 == "DOGE" ]]; then stdbuf -oL nohup ~/mmtools/mpm_run DOGE dogecoin > $mmtoolslogfile & else - echo "Choose from BTC, KMD, BCH, LTC or DOGE." + echo "Choose from BTC-segwit, KMD, BCH, LTC-segwit or DOGE." fi diff --git a/orderbook b/orderbook index dc21bb3..01d7568 100755 --- a/orderbook +++ b/orderbook @@ -2,7 +2,7 @@ # # Output nicely formatted orderbooks # -# Usage: ./orderbook btc kmd +# Usage: ./orderbook btc-segwit kmd # # @author webworker01 # @link https://developers.atomicdex.io/basic-docs/atomicdex-api-legacy/orderbook.html @@ -22,21 +22,21 @@ orderbooks=$(curl -s --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$user if [[ ! -z $remote ]] && (( $remote > 0 )); then priceinfo=$(curl -s --url "https://komodostats.com/api/price/pair.json?coin1=${coin1}&coin2=${coin2}") - coin1val=$(jq -r --arg coinkey ${coin1} '.[$coinkey].price_btc' <<< $priceinfo) - coin2val=$(jq -r --arg coinkey ${coin2} '.[$coinkey].price_btc' <<< $priceinfo) + coin1val=$(jq -r --arg coinkey ${coin1} '.[$coinkey].price_btc-segwit' <<< $priceinfo) + coin2val=$(jq -r --arg coinkey ${coin2} '.[$coinkey].price_btc-segwit' <<< $priceinfo) fi if [[ ! -z $coin1val ]] && [[ $coin1val != "null" && $coin1val != "0.00000000" ]] && [[ ! -z $coin2val ]] && [[ $coin2val != "null" && $coin2val != "0.00000000" ]]; then echo "-- ${coin1}: ₿ ${coin1val} ${coin2}: ₿ ${coin2val} --" echo "--Bids (Selling ${coin2} for ${coin1})--" - printf "%-7s %-34s %-34s %20s %20s %20s %20s %20s %6s\n" "Coin" "Address" "UUID" "Price ${coin2}/${coin1}" "Volume ${coin1}" "Volume ${coin2}" "Price ${coin1}/${coin2}" "Price BTC/${coin2}" "Diff %" + printf "%-7s %-34s %-34s %20s %20s %20s %20s %20s %6s\n" "Coin" "Address" "UUID" "Price ${coin2}/${coin1}" "Volume ${coin1}" "Volume ${coin2}" "Price ${coin1}/${coin2}" "Price BTC-segwit/${coin2}" "Diff %" printf "%-7s %-34s %-34s %20s %20s %20s %20s %20s %4s\n" "----" "-------" "----" "-------------" "----------" "----------" "-------------" "-------------" "------" bids=$(jq -rc --arg coin1price ${coin1val} --arg coin2price ${coin2val} '.bids | sort_by((.price|tonumber)) | .[] | [.coin, .address, .uuid, .price, ((.maxvolume|tonumber)/(.price|tonumber)), .maxvolume, (1/(.price|tonumber)), (1/(.price|tonumber)*($coin1price|tonumber)), (((1/(.price|tonumber)*($coin1price|tonumber))-($coin2price|tonumber))/($coin2price|tonumber))*100 ] | @tsv' <<< $orderbooks) awk '{printf("%-6s %35s %35s %20.8f %20.8f %20.8f %20.8f %20.8f %6.2f\n", $1, $2, $3, $4, $5, $6, $7, $8, $9)}' <<< $bids echo echo "--Asks (Buying ${coin2} with ${coin1})--" - printf "%-7s %-34s %-34s %20s %20s %20s %20s %20s %6s\n" "Coin" "Address" "UUID" "Price ${coin2}/${coin1}" "Volume ${coin1}" "Volume ${coin2}" "Price ${coin1}/${coin2}" "Price BTC/${coin2}" "Diff %" + printf "%-7s %-34s %-34s %20s %20s %20s %20s %20s %6s\n" "Coin" "Address" "UUID" "Price ${coin2}/${coin1}" "Volume ${coin1}" "Volume ${coin2}" "Price ${coin1}/${coin2}" "Price BTC-segwit/${coin2}" "Diff %" printf "%-7s %-34s %-34s %20s %20s %20s %20s %20s %4s\n" "----" "-------" "----" "-------------" "----------" "----------" "-------------" "-------------" "------" asks=$(jq -r --arg coin1price ${coin1val} --arg coin2price ${coin2val} '.asks | sort_by((.price|tonumber)) | .[] | [.coin, .address, .uuid, .price, .maxvolume, ((.maxvolume|tonumber)*(.price|tonumber)), (1/(.price|tonumber)), (1/(.price|tonumber)*($coin1price|tonumber)), (((1/(.price|tonumber)*($coin1price|tonumber))-($coin2price|tonumber))/($coin2price|tonumber))*100 ] | @tsv' <<< $orderbooks) # asks=$(jq -r --arg coin1price ${coin1val} --arg coin2price ${coin2val} '.asks | sort_by((.price|tonumber)) | .[] | [.coin, .address, .price, .maxvolume, ((.maxvolume|tonumber)*(.price|tonumber)), (1/(.price|tonumber)), (1/(.price|tonumber)*($coin1price|tonumber)), (((1/(.price|tonumber)*($coin1price|tonumber))-$coin1price|tonumber)/$coin1price|tonumber) ] | @tsv' <<< $orderbooks) diff --git a/sell b/sell index a1e0f79..284d0dd 100755 --- a/sell +++ b/sell @@ -2,8 +2,8 @@ # # Automatically sets a taker order with miner and dex fees calculated # -# Usage: ./sell kmd btc 0.0001 10000 -# (Tries to sell 10000 KMD at a price of 0.0001 BTC/KMD) +# Usage: ./sell kmd btc-segwit 0.0001 10000 +# (Tries to sell 10000 KMD at a price of 0.0001 BTC-segwit/KMD) # # @author webworker01 # @link https://developers.atomicdex.io/basic-docs/atomicdex-api-legacy/sell.html