Quantcast
Channel: Mining — Ethereum Community Forum
Viewing all articles
Browse latest Browse all 10806

Linux/BSD ethermine.org users: bash script for pool stats & profitability (multi-currency)

$
0
0
So I threw together a bash script (intended to be run as part of a 'screen' session along with ethminer, or at regular intervals using 'watch') that fetches data from the JSON API and, taking information on overall wattage, power costs and local currency from the command line, spits out a handful of statistics including hashrate, projected returns, power costs, estimated net profits and ratio of power costs to output.

It also provides local currency conversion; you can supply power costs in GBP, EUR, CAD, AUD (and many others) as well as in USD. If your currency is known to fixer.io, the script should support it and will apply the relevant conversions to your power costs and projected returns. Finally, for ease of comparison with X11 and/or Cryptonight mining, the script provides equivalents in DASH and XMR for your projected ETH outputs using shapeshift.io for conversion rates. The (fairly) lengthy script follows below, but if you're on a Linux/BSD system (with bash, lynx and jq installed) you can probably inspect and use it more easily by downloading it from pastebin in a terminal:


wget -qO- http://pastebin.com/raw/riKN04X8 | sed -e "s/\r//g" > ethermine_stats
cat ethermine_stats
chmod 700 ethermine_stats
./ethermine_stats help


Sample of output (where local currency is British Pounds) - the script behaves similarly for EUR, CAD, AUD, etc.:


root@precision:~$./ethermine_stats 0xc91B3f6a889a9963c7eaE2d5BD5Ca88a6Ae2d2EA 506 0.10629*1.05*0.98 GBP
--------------------------------------------------------------------------------------------------------------------------------------------
ethermine.org pool, power and profitability statistics for Linux, version 0.8 (Sun 9 Oct 16:29:34 BST 2016)
--------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------
Hash rate and power consumption
--------------------------------------------------------------------------------------------------------------------------------------------

Hashrate: 82.0 MH/sec (average hash rate over the last 24 hours)
90.0 MH/sec (current hash rate over the last few minutes)

Electricity: 506 watts continuous load
6.17 watts per MH/sec
Power costs 34.11% of output (calculated from USD power cost as percentage of USD returns)

Unpaid: 0.89791481 ETH (amount accumulated at the pool towards next payout)

Next Ether in: 6 hours, 15 minutes (estimate: Sun 9 Oct 22:44:35 BST 2016)

--------------------------------------------------------------------------------------------------------------------------------------------
Estimated rewards
--------------------------------------------------------------------------------------------------------------------------------------------

Output (ETH): 0.39109751 ETH/day (net: 0.25769414 ETH/day after power cost)
2.73768259 ETH/week (net: 1.80385905 ETH/week)
11.90403057 ETH/month (net: 7.84356574 ETH/month)
142.84836690 ETH/year (net: 94.12278895 ETH/year)
Output (BTC): 0.00773023 BTC/day (net: 0.00509344 BTC/day)
0.05411166 BTC/week (net: 0.03565417 BTC/week)
0.23528911 BTC/month (net: 0.15503199 BTC/month)
2.82346939 BTC/year (net: 1.86038398 BTC/year)
Exchange (DASH): 0.40217136 DASH/day (net: 0.26499070 DASH/day @ 1.02831482 DASH/ETH; exchange rate: shapeshift.io)
2.81519957 DASH/week (net: 1.85493499 DASH/week)
12.24109105 DASH/month (net: 8.06565489 DASH/month)
146.89309269 DASH/year (net: 96.78785877 DASH/year)
Exchange (XMR): 0.67525741 XMR/day (net: 0.44492709 XMR/day @ 1.72657048 XMR/ETH; exchange rate: shapeshift.io)
4.72680194 XMR/week (net: 3.11448978 XMR/week)
20.55314777 XMR/month (net: 13.54246906 XMR/month)
246.63777340 XMR/year (net: 162.50962889 XMR/year)
Exchange (BTC): 0.00768298 BTC/day (net: 0.00506232 BTC/day @ 0.01964469 BTC/ETH; exchange rate: shapeshift.io)
0.05378092 BTC/week (net: 0.03543625 BTC/week)
0.23385099 BTC/month (net: 0.15408441 BTC/month)
2.80621188 BTC/year (net: 1.84901301 BTC/year)
Exchange (GBP): 3.88 GBP/day (converted from 4.78 USD @ 0.81107 USD/GBP; exchange rate: fixer.io)
27.13 GBP/week (converted from 33.45 USD @ 0.81107 USD/GBP)
117.96 GBP/month (converted from 145.43 USD @ 0.81107 USD/GBP)
1415.49 GBP/year (converted from 1745.21 USD @ 0.81107 USD/GBP)
Power (GBP): 1.32 GBP/day (12.144 kWh/day @ 0.10937241GBP/kWh = 1.63 USD/day @ 1.2329 GBP/USD = 0.13484524 USD/kWh)
9.29 GBP/week (85.008 kWh/week @ 0.10937241GBP/kWh = 11.46 USD/week
40.17 GBP/month (369.633 kWh/month @ 0.10937241GBP/kWh = 49.61 USD/month
482.13 GBP/year (4435.596 kWh/year @ 0.10937241GBP/kWh = 595.35 USD/year
--------------------------------------------------------------------------------------------------------------------------------------------
Net (GBP): 2.55 GBP/day (converted from 3.15 USD @ 0.81107 USD/GBP; exchange rate: fixer.io)
17.83 GBP/week (converted from 21.99 USD @ 0.81107 USD/GBP)
77.72 GBP/month (converted from 95.82 USD @ 0.81107 USD/GBP)
932.61 GBP/year (converted from 1149.86 USD @ 0.81107 USD/GBP)
--------------------------------------------------------------------------------------------------------------------------------------------


Sample of output using same rig data but with local currency USD and cost per kWh is $0.12:


root@precision:~$./ethermine_stats 0xc91B3f6a889a9963c7eaE2d5BD5Ca88a6Ae2d2EA 506 0.12 USD
--------------------------------------------------------------------------------------------------------------------------------------------
ethermine.org pool, power and profitability statistics for Linux, version 0.8 (Sun 9 Oct 16:34:41 BST 2016)
--------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------
Hash rate and power consumption
--------------------------------------------------------------------------------------------------------------------------------------------

Hashrate: 82.0 MH/sec (average hash rate over the last 24 hours)
86.3 MH/sec (current hash rate over the last few minutes)

Electricity: 506 watts continuous load
6.17 watts per MH/sec
Power costs 30.34% of output (calculated from USD power cost as percentage of USD returns)

Unpaid: 0.89917497 ETH (amount accumulated at the pool towards next payout)

Next Ether in: 6 hours, 11 minutes (estimate: Sun 9 Oct 22:45:41 BST 2016)

--------------------------------------------------------------------------------------------------------------------------------------------
Estimated rewards
--------------------------------------------------------------------------------------------------------------------------------------------

Output (ETH): 0.39114715 ETH/day (net: 0.27247310 ETH/day after power cost)
2.73803006 ETH/week (net: 1.90731173 ETH/week)
11.90554145 ETH/month (net: 8.29340017 ETH/month)
142.86649750 ETH/year (net: 99.52080215 ETH/year)
Output (BTC): 0.00773121 BTC/day (net: 0.00538556 BTC/day)
0.05411853 BTC/week (net: 0.03769896 BTC/week)
0.23531897 BTC/month (net: 0.16392319 BTC/month)
2.82382775 BTC/year (net: 1.96707841 BTC/year)
Exchange (DASH): 0.40245128 DASH/day (net: 0.28034755 DASH/day @ 1.02889995 DASH/ETH; exchange rate: shapeshift.io)
2.81715899 DASH/week (net: 1.96243294 DASH/week)
12.24961100 DASH/month (net: 8.53307902 DASH/month)
146.99533213 DASH/year (net: 102.39694835 DASH/year)
Exchange (XMR): 0.67554160 XMR/day (net: 0.47058227 XMR/day @ 1.72707792 XMR/ETH; exchange rate: shapeshift.io)
4.72879126 XMR/week (net: 3.29407597 XMR/week)
20.56179776 XMR/month (net: 14.32334831 XMR/month)
246.74157333 XMR/year (net: 171.88017997 XMR/year)
Exchange (BTC): 0.00768279 BTC/day (net: 0.00535183 BTC/day @ 0.0196417 BTC/ETH; exchange rate: shapeshift.io)
0.05377956 BTC/week (net: 0.03746284 BTC/week)
0.23384507 BTC/month (net: 0.16289647 BTC/month)
2.80614088 BTC/year (net: 1.95475773 BTC/year)
Output (USD): 4.78 USD/day (estimated from current performance, with data & exchange rates supplied by the pool)
33.45 USD/week
145.45 USD/month
1745.43 USD/year
Power (USD): 1.45 USD/day (12.144 kWh/day @ 0.12 USD/kWh)
10.19 USD/week (85.008 kWh/week @ 0.12 USD/kWh)
44.13 USD/month (369.633 kWh/month @ 0.12 USD/kWh)
529.61 USD/year (4435.596 kWh/year @ 0.12 USD/kWh)
--------------------------------------------------------------------------------------------------------------------------------------------
Net (USD): 3.33 USD/day
23.26 USD/week
101.32 USD/month
1215.82 USD/year
--------------------------------------------------------------------------------------------------------------------------------------------


The script itself follows. As above, it's probably easier to download it from pastebin, but always take care to inspect any script installed onto your system in this fashion before you trust it. Suggested usage (absent a screen session running ethminer) is to invoke it with

watch -n 60 ./ethermine_stats <addr> <wattage> <cost_per_kwh> <currency>

And the script:


#!/bin/bash
# Ethermine.org stats and power cost calculations script
#
# v0.1 proof of concept
# v0.2 adds time to next Ether calculation with human-friendly timeframe and datestamps
# adds number padding to prettify output and permit later addition of multiple currencies
# reordered output for aesthetic reasons; tabbed data first
# adds separate padding function for fiat currencies; work to two decimal places
# v0.3 brings energy cost calcs into a function, avoids dependence on a separate script
# - despite the variable names, this supports any input currency known to fixer.io
# - simplified function to avoid needing external commands to extract data from it
# - adds power reporting in kWh, not just USD power cost
# v0.4 improves multi-currency support
# - fetch a currency conversion rate for power costs only if currency != USD
# - fetch currency conversion data once per script run, not recursively within functions
# - add functions to return a conversion from USD to local currency and vice versa
# - add conversion of gross returns to local currency in which power cost is given
# - show the conversion rate from local to USD alongside
# - add reporting of power costs in local currency before USD conversion
# - add conversion of net returns to local currency
# - tested with USD, GBP, CAD, AUD, EUR, others probably work
# v0.5 improves relevance of output in light of multi-currency support
# - suppress redundant output where currency = USD, use local currency when relevant
# - show currency conversion workings alongside returns in local currency
# - suppress redundant output where currency != USD and workings shown alongside
# - suppress 4 lines of output for power costs in non-local currency
# - suppress 4 lines of output for power costs in kWh; workings alongside fiat costs
# - process work data from last 100 rounds for average hashrate
# - tidy up the output
# v0.6 - if we have a /tmp/wattage file, let it override the command line variable. This
# allows us to vary the specified wattage on the fly once the script is running e.g.
# when running in screen, basically to set wattage in line with variable rig usage
# or clock speeds.
# - add calculation for watts per MH/s
# - add more explanatory notes as to data sources; add long padding function
# v0.7 Fixed average hash rate to use the 24h average from the pool rather than data from
# the last 100 rounds. Oops. Tidied up formatting a bit, prettified. Still no worker
# data as yet; this is pitched at global statistics so far.
# - suppress redundant currency conversions in power costs
# - add net estimate calculations for ETH and BTC values alongside gross estimates
# v0.8 Adds support for output equivalents in altcoin using the ShapeShift HTTP API. The
# initial implementation adds an ETH-DASH conversion for comparison with X11 mining.
# - change description to "exchange" where a third-party exchange rate is involved
# - add exchange rate for BTC from Shapeshift.io; see how far it deviates from pool
# - add exchange rate for XMR from Shapeshift.io, because we can
# - support addresses with or without a leading 0x
# - add some help text, trigger it on improper or inadequate input
# - removed surplus blank lines
version="0.8";
watts=$2;
[ -r /tmp/wattage ] && watts=`cat /tmp/wattage`;
function help {
echo "";
echo "Usage: ./ethermine_stats <address> <total_wattage> <cost_per_kwh> <currency_code>";
echo "";
echo "where";
echo "";
echo "<address> your miner address as used at the pool";
echo "<total_wattage> power consumption in watts of the mining rigs on this address";
echo "<cost_per_kwh> as a decimal price per kWh, such as 0.10629 or whatever";
echo "<currency_code> your local currency: USD, GBP, EUR, CAD, AUD etc.";
echo "";
echo "You can use expressions for cost_per_kWh, such as 0.10629*1.05*0.98, if for instance";
echo "you have a base cost per kWh on which you pay 5% VAT but get 2% cashback on the total";
echo "amount (as happens to apply to the author). Examples:";
echo ""
echo "./ethermine_stats 0xc91B3f6a889a9963c7eaE2d5BD5Ca88a6Ae2d2EA 506 0.10629*1.05*0.98 GBP"
echo "";
echo "./ethermine_stats 0xc91B3f6a889a9963c7eaE2d5BD5Ca88a6Ae2d2EA 500 0.12 USD"
echo "";
echo "./ethermine_stats 0xc91B3f6a889a9963c7eaE2d5BD5Ca88a6Ae2d2EA 500 0.14 EUR"
echo "";
echo "The intention is that this script will typically be run at regular intervals, such as";
echo "with 'watch -n60 ./ethermine_stats [args]' and that it should remain compatible with";
echo "such use as part of a 'screen' session running ethminer and a host of other scripts.";
echo ""
echo "For the same reason, output is sized to fit in one page of a 140-character (or more)"
echo "terminal window. More functionality is planned, including per-worker statistics, use"
echo "of payouts data and potentially interfaces to other third-party services, but these"
echo "will most likely be implemented as separate functions to the main statistics page."
}
function lineohash {
for ((i=0;i<139;i++)); do echo -n "#"; done; echo "#";
}
function lineodash {
for ((i=0;i<139;i++)); do echo -n "-"; done; echo "-";
}
lineodash
echo "ethermine.org pool, power and profitability statistics for Linux, version $version (`date`)"
lineodash
[[ "$4" == "" ]] && help && exit 0;
[[ "$3" == "" ]] && help && exit 0;
[[ "$2" == "" ]] && help && exit 0;
[[ "$1" == "" ]] && help && exit 0;
function energycosts {
WATTS=$1
PERKWH=$2
CUR=$3
VAR=$4
GBPKWH="`bc <<< "scale=6; x=$PERKWH; if(x<1) print 0; x"`";
[[ "$CUR" == "USD" ]] && GBPTOUSD="1.0" || GBPTOUSD=$(loc2usd 1);
USDKWH="`bc <<< "scale=6; x=$PERKWH*$GBPTOUSD; if(x<1) print 0; x"`";
KWHDAY="`/usr/bin/bc <<< "scale=3; x=$WATTS*24/1000; if(x<1) print 0; x"`";
USDDAY="`/usr/bin/bc <<< "scale=2; x=$KWHDAY*$USDKWH/1; if(x<1) print 0; x"`";
GBPDAY="`/usr/bin/bc <<< "scale=2; x=$KWHDAY*$GBPKWH/1; if(x<1) print 0; x"`";
KWHWEEK="`/usr/bin/bc <<< "scale=3; x=$WATTS*24*7/1000; if(x<1) print 0; x"`";
USDWEEK="`/usr/bin/bc <<< "scale=2; x=$KWHDAY*$USDKWH*7/1; if(x<1) print 0; x"`";
GBPWEEK="`/usr/bin/bc <<< "scale=2; x=$KWHDAY*$GBPKWH*7/1; if(x<1) print 0; x"`";
KWHYEAR="`/usr/bin/bc <<< "scale=3; x=$KWHDAY*365.25; if(x<1) print 0; x"`";
USDYEAR="`/usr/bin/bc <<< "scale=2; x=$USDDAY*365.25; if(x<1) print 0; x"`";
GBPYEAR="`/usr/bin/bc <<< "scale=2; x=$GBPDAY*365.25; if(x<1) print 0; x"`";
KWHMO="`/usr/bin/bc <<< "scale=3; x=$KWHYEAR/12; if(x<1) print 0; x"`";
USDMO="`/usr/bin/bc <<< "scale=2; x=$USDYEAR/12; if(x<1) print 0; x"`";
GBPMO="`/usr/bin/bc <<< "scale=2; x=$GBPYEAR/12; if(x<1) print 0; x"`";
case "$5" in
"$CUR")
[[ "$4" == "day" ]] && echo $GBPDAY;
[[ "$4" == "week" ]] && echo $GBPWEEK;
[[ "$4" == "month" ]] && echo $GBPMO;
[[ "$4" == "year" ]] && echo $GBPYEAR;
;;
"kWh")
[[ "$4" == "day" ]] && echo $KWHDAY;
[[ "$4" == "week" ]] && echo $KWHWEEK;
[[ "$4" == "month" ]] && echo $KWHMO;
[[ "$4" == "year" ]] && echo $KWHYEAR;
;;
*)
[[ "$4" == "day" ]] && echo $USDDAY;
[[ "$4" == "week" ]] && echo $USDWEEK;
[[ "$4" == "month" ]] && echo $USDMO;
[[ "$4" == "year" ]] && echo $USDYEAR;
;;
esac
}
function pad {
out="`echo $1 | sed -e :a -e 's/^.\{1,13\}$/& /;ta'`";
echo "$out";
}
function p {
out="`echo $1 | sed -e :a -e 's/^.\{1,12\}$/& /;ta'`";
echo "$out";
}
function pl {
out="`echo $1 | sed -e :a -e 's/^.\{1,27\}$/& /;ta'`";
echo "$out";
}
function padf {
#Version for fiat currency, work to two decimal places
out="`printf %.2f $(echo $1 | bc -l) | sed -e :a -e 's/^.\{1,13\}$/& /;ta'`";
echo "$out";
}
function truncf {
#Version for fiat currency, work to two decimal places
out="`printf %.2f $(echo $1 | bc -l)`";
echo "$out";
}
case $4 in
"USD")
LOC2USD=1;
USD2LOC=1;
;;
*)
LOC2USD=`wget -q -O- "http://api.fixer.io/latest?base=$4&symbols=USD" | jq .rates.USD`
USD2LOC=`wget -q -O- "http://api.fixer.io/latest?base=USD&symbols=$4" | jq .rates.$4`
;;
esac
function loc2usd {
usd=`bc <<< "scale=8; x=$1*$LOC2USD; if(x<1) print 0; x"`;
echo $usd;
}
function usd2loc {
loc=`bc <<< "scale=8; x=$1*$USD2LOC; if(x<1) print 0; x"`;
echo $loc;
}
ETH2DASH=`wget -q -O- https://shapeshift.io/marketinfo/eth_dash | jq .rate`;
ETH2BTC=`wget -q -O- https://shapeshift.io/marketinfo/eth_btc | jq .rate`;
ETH2XMR=`wget -q -O- https://shapeshift.io/marketinfo/eth_xmr | jq .rate`;
function eth2alt {
amount=$1;
dest=$2;
[[ "$dest" == "DASH" ]] && rate="$ETH2DASH";
[[ "$dest" == "BTC" ]] && rate="$ETH2BTC";
[[ "$dest" == "XMR" ]] && rate="$ETH2XMR";
alt=`bc <<< "scale=8; x=$amount*$rate; if(x<1) print 0; x"`;
echo $alt;
}
address="`echo $1 | sed -e 's/0x//g'`";
w=$2
perkwh=`bc <<< "scale=8; x=$3; if(x<1) print 0; x"`
cur=$4
json="`wget -q -O - http://ethermine.org/api/miner_new/$address`";
hashrate=`echo "$json" | jq .hashRate | sed -e s/\"//g | awk {'print $1'}`;
hashrate0=$(bc <<< "scale=2; x=$hashrate; x");
avghashrate=`echo "$json" | jq .avgHashrate | sed -e s/\"//g | awk {'print $1'}`;
avghashrate0=$(bc <<< "scale=1; x=$avghashrate/1000000; x");
padhashrate=$(pad $hashrate);
epm=`echo "$json" | jq .ethPerMin`;
bpm=`echo "$json" | jq .btcPerMin`;
upm=`echo "$json" | jq .usdPerMin`;
bpm=`echo "${bpm}" | sed -e 's/[eE]+*/\\*10\\^/'`
unpaidf=`echo "$json" | jq .unpaid`;
unpaid=$(pad `bc <<< "scale=8; x=$unpaidf/1000000000000000000; if(x<1) print 0; x"`);
tomine=`bc <<< "scale=8; x=1-$unpaid; if(x<1) print 0; x"`;
minstomine=`bc <<< "scale=0; x=$tomine/$epm; if(x<1) print 0; x"`;
hourstomine=`bc <<< "scale=0; x=$minstomine/60; if(x<1) print 0; x"`;
daystomine=`bc <<< "scale=0; x=$minstomine/60/24; x"`;
timeframe="";
[[ "$daystomine" -gt "0" ]] && timeframe="$daystomine days";
[[ "$daystomine" -eq "0" ]] && [[ "$hourstomine" -gt "0" ]] && timeframe="$hourstomine hours";
[[ "$daystomine" -eq "0" ]] && [[ "$hourstomine" -eq "0" ]] && timeframe="$minstomin minutes.";
[[ "$daystomine" -gt 0 ]] && remainderhours="`bc <<< "scale=0; x=$hourstomine-($daystomine*24); x"`" && timeframe="$timeframe, $remainderhours hours";
[[ "$hourstomine" -gt 0 ]] && remainder="`bc <<< "scale=0; x=$minstomine-($hourstomine*60); x"`" && timeframe="$timeframe, $remainder minutes";
timestampnow="`date +%s`";
timestampnext="`bc <<< "scale=0; x=$timestampnow+($minstomine*60); x"`";
timestamp="`date -d "@$timestampnext"`";
eph=`bc <<< "scale=2; x=$epm*60/1; if(x<1) print 0; x"`;
epd=`bc <<< "scale=8; x=$epm*60*24/1; if(x<1) print 0; x"`;
epw=`bc <<< "scale=8; x=$epm*60*24*7/1; if(x<1) print 0; x"`;
epy=`bc <<< "scale=8; x=$epm*60*24*365.25/1; if(x<1) print 0; x"`;
epmo=`bc <<< "scale=8; x=$epy/12; if(x<1) print 0; x"`;
uph=`bc <<< "scale=2; x=$upm*60/1; if(x<1) print 0; x"`;
upd=`bc <<< "scale=8; x=$upm*60*24/1; if(x<1) print 0; x"`;
upw=`bc <<< "scale=8; x=$upm*60*24*7/1; if(x<1) print 0; x"`;
upy=`bc <<< "scale=8; x=$upm*60*24*365.25/1; if(x<1) print 0; x"`;
upmo=`bc <<< "scale=8; x=$upy/12; if(x<1) print 0; x"`;
bph=`bc <<< "scale=2; x=$bpm*60/1; if(x<1) print 0; x"`;
bpd=`bc <<< "scale=8; x=$bpm*60*24/1; if(x<1) print 0; x"`;
bpw=`bc <<< "scale=8; x=$bpm*60*24*7/1; if(x<1) print 0; x"`;
bpy=`bc <<< "scale=8; x=$bpm*60*24*365.25/1; if(x<1) print 0; x"`;
bpmo=`bc <<< "scale=8; x=$bpy/12; if(x<1) print 0; x"`;
cpd=$(energycosts "$watts" "$3" "$4" "day")
cpw=$(energycosts "$watts" "$3" "$4" "week")
cpm=$(energycosts "$watts" "$3" "$4" "month")
cpy=$(energycosts "$watts" "$3" "$4" "year")
lcpd=$(energycosts "$watts" "$3" "$4" "day" "$4")
lcpw=$(energycosts "$watts" "$3" "$4" "week" "$4")
lcpm=$(energycosts "$watts" "$3" "$4" "month" "$4")
lcpy=$(energycosts "$watts" "$3" "$4" "year" "$4")
wpd=$(energycosts "$watts" "$3" "$4" "day" "kWh")
wpw=$(energycosts "$watts" "$3" "$4" "week" "kWh")
wpm=$(energycosts "$watts" "$3" "$4" "month" "kWh")
wpy=$(energycosts "$watts" "$3" "$4" "year" "kWh")
pct=$(truncf `bc <<< "scale=5; x=(($cpy/$upy)*100); x"`);
keep=$(truncf `bc <<< "scale=5; x=(100-$pct); x"`);
wpmhs=$(truncf `bc <<< "scale=5; x=($watts/$avghashrate0); x"`);
nepd=`bc <<< "scale=8; x=$epd*($keep/100); if(x<1) print 0; x"`;
nepw=`bc <<< "scale=8; x=$epw*($keep/100); if(x<1) print 0; x"`;
nepy=`bc <<< "scale=8; x=$epy*($keep/100); if(x<1) print 0; x"`;
nepmo=`bc <<< "scale=8; x=$epmo*($keep/100); if(x<1) print 0; x"`;
nbpd=`bc <<< "scale=8; x=$bpd*($keep/100); if(x<1) print 0; x"`;
nbpw=`bc <<< "scale=8; x=$bpw*($keep/100); if(x<1) print 0; x"`;
nbpy=`bc <<< "scale=8; x=$bpy*($keep/100); if(x<1) print 0; x"`;
nbpmo=`bc <<< "scale=8; x=$bpmo*($keep/100); if(x<1) print 0; x"`;
lineodash
echo "Hash rate and power consumption"
lineodash
echo ""
echo "Hashrate: $(pad $avghashrate0) $(p MH/sec) (average hash rate over the last 24 hours)"
echo " $(pad $hashrate0) $(p MH/sec) (current hash rate over the last few minutes)"
echo ""
echo "Electricity: $(pl "$watts watts continuous load")"
echo " $(pl "$wpmhs watts per MH/sec")"
echo " $(pl "Power costs $pct% of output") (calculated from USD power cost as percentage of USD returns)"
echo ""
echo "Unpaid: $(pad $unpaid) $(p ETH) (amount accumulated at the pool towards next payout)";
echo ""
echo "Next Ether in: $(pl "$timeframe") (estimate: $timestamp)";
#echo " at: $timestamp";
echo ""
lineodash
echo "Estimated rewards"
lineodash
echo ""
echo "Output (ETH): $(pad $epd) $(p ETH/day) (net: $nepd ETH/day after power cost)"
echo " $(pad $epw) $(p ETH/week) (net: $nepw ETH/week)"
echo " $(pad $epmo) $(p ETH/month) (net: $nepmo ETH/month)"
echo " $(pad $epy) $(p ETH/year) (net: $nepy ETH/year)"
echo "Output (BTC): $(pad $bpd) $(p BTC/day) (net: $nbpd BTC/day)"
echo " $(pad $bpw) $(p BTC/week) (net: $nbpw BTC/week)"
echo " $(pad $bpmo) $(p BTC/month) (net: $nbpmo BTC/month)"
echo " $(pad $bpy) $(p BTC/year) (net: $nbpy BTC/year)"
echo "Exchange (DASH): $(pad $(eth2alt $epd DASH)) $(p DASH/day) (net: $(eth2alt $nepd DASH) DASH/day @ $ETH2DASH DASH/ETH; exchange rate: shapeshift.io)"
echo " $(pad $(eth2alt $epw DASH)) $(p DASH/week) (net: $(eth2alt $nepw DASH) DASH/week)"
echo " $(pad $(eth2alt $epmo DASH)) $(p DASH/month) (net: $(eth2alt $nepmo DASH) DASH/month)"
echo " $(pad $(eth2alt $epy DASH)) $(p DASH/year) (net: $(eth2alt $nepy DASH) DASH/year)"
echo "Exchange (XMR): $(pad $(eth2alt $epd XMR)) $(p XMR/day) (net: $(eth2alt $nepd XMR) XMR/day @ $ETH2XMR XMR/ETH; exchange rate: shapeshift.io)"
echo " $(pad $(eth2alt $epw XMR)) $(p XMR/week) (net: $(eth2alt $nepw XMR) XMR/week)"
echo " $(pad $(eth2alt $epmo XMR)) $(p XMR/month) (net: $(eth2alt $nepmo XMR) XMR/month)"
echo " $(pad $(eth2alt $epy XMR)) $(p XMR/year) (net: $(eth2alt $nepy XMR) XMR/year)"
echo "Exchange (BTC): $(pad $(eth2alt $epd BTC)) $(p BTC/day) (net: $(eth2alt $nepd BTC) BTC/day @ $ETH2BTC BTC/ETH; exchange rate: shapeshift.io)"
echo " $(pad $(eth2alt $epw BTC)) $(p BTC/week) (net: $(eth2alt $nepw BTC) BTC/week)"
echo " $(pad $(eth2alt $epmo BTC)) $(p BTC/month) (net: $(eth2alt $nepmo BTC) BTC/month)"
echo " $(pad $(eth2alt $epy BTC)) $(p BTC/year) (net: $(eth2alt $nepy BTC) BTC/year)"
case $4 in
"USD")
echo "Output (USD): $(padf $upd) $(p USD/day) (estimated from current performance, with data & exchange rates supplied by the pool)"
echo " $(padf $upw) USD/week"
echo " $(padf $upmo) USD/month"
echo " $(padf $upy) USD/year"
;;
*)
echo "Exchange ($4): $(padf $(usd2loc $upd)) $(p $4/day) (converted from $(truncf "scale=2; $upd"|bc) USD @ $(usd2loc 1) USD/$4; exchange rate: fixer.io)"
echo " $(padf $(usd2loc $upw)) $(p $4/week) (converted from $(truncf "scale=2; $upw"|bc) USD @ $(usd2loc 1) USD/$4)"
echo " $(padf $(usd2loc $upmo)) $(p $4/month) (converted from $(truncf "scale=2; $upmo"|bc) USD @ $(usd2loc 1) USD/$4)"
echo " $(padf $(usd2loc $upy)) $(p $4/year) (converted from $(truncf "scale=2; $upy"|bc) USD @ $(usd2loc 1) USD/$4)"
;;
esac
#echo "Power (kWh): $(padf $wpd) kWh/day"
#echo " $(padf $wpw) kWh/week"
#echo " $(padf $wpm) kWh/month"
#echo " $(padf $wpy) kWh/year"
case $4 in
"USD")
echo "Power (USD): $(padf $cpd) $(p USD/day) ($wpd kWh/day @ $perkwh $4/kWh)"
echo " $(padf $cpw) $(p USD/week) ($wpw kWh/week @ $perkwh $4/kWh)"
echo " $(padf $cpm) $(p USD/month) ($wpm kWh/month @ $perkwh $4/kWh)"
echo " $(padf $cpy) $(p USD/year) ($wpy kWh/year @ $perkwh $4/kWh)"
;;
*)
echo "Power ($4): $(padf $lcpd) $(p $4/day) ($wpd kWh/day @ $perkwh$4/kWh = $cpd USD/day @ $(loc2usd 1) $4/USD = $(loc2usd $perkwh) USD/kWh)"
echo " $(padf $lcpw) $(p $4/week) ($wpw kWh/week @ $perkwh$4/kWh = $cpw USD/week"
echo " $(padf $lcpm) $(p $4/month) ($wpm kWh/month @ $perkwh$4/kWh = $cpm USD/month"
echo " $(padf $lcpy) $(p $4/year) ($wpy kWh/year @ $perkwh$4/kWh = $cpy USD/year"
;;
esac
lineodash
case $4 in
"USD")
echo "Net (USD): $(padf `echo "scale=2; $upd-$cpd"|bc`) USD/day";
echo " $(padf `echo "scale=2; $upw-$cpw"|bc`) USD/week";
echo " $(padf `echo "scale=2; $upmo-$cpm"|bc`) USD/month";
echo " $(padf `echo "scale=2; $upy-$cpy"|bc`) USD/year";
;;
*)
echo "Net ($4): $(padf `echo "scale=2; ($upd-$cpd)*$USD2LOC"|bc`) $(p $4/day) (converted from $(truncf "scale=2; $upd-$cpd"|bc) USD @ $(usd2loc 1) USD/$4; exchange rate: fixer.io)";
echo " $(padf `echo "scale=2; ($upw-$cpw)*$USD2LOC"|bc`) $(p $4/week) (converted from $(truncf "scale=2; $upw-$cpw"|bc) USD @ $(usd2loc 1) USD/$4)";
echo " $(padf `echo "scale=2; ($upmo-$cpm)*$USD2LOC"|bc`) $(p $4/month) (converted from $(truncf "scale=2; $upmo-$cpm"|bc) USD @ $(usd2loc 1) USD/$4)";
echo " $(padf `echo "scale=2; ($upy-$cpy)*$USD2LOC"|bc`) $(p $4/year) (converted from $(truncf "scale=2; $upy-$cpy"|bc) USD @ $(usd2loc 1) USD/$4)";
;;
esac
lineodash
echo ""
echo "Useful? Feel free to leave me a tip. ETH: 0x58f7F4d641dc32A4a1349aad866F132C6794659e / BTC: 155D6ZLLUezX6c8k6CXTUgF55qDP1P2Uz4 - Thanks!"





Viewing all articles
Browse latest Browse all 10806

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>