Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use segwit coins #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions buy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions mpm_config
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions mpm_start
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions orderbook
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions sell
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down