include daily profit estimates in algo-log (in BTC and local currency)

This commit is contained in:
2017-09-02 13:12:22 -07:00
parent 3a65b88978
commit 818fa062ab
2 changed files with 5 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{
"currency": "USD",
"pwrcost": 0.12,
"pwrcost": 0.107,
"min_profit": 0.0,
"payment_addr": "1TipsGocnz2N5qgAm9f7JLrsMqkb3oXe2",
"miner_name": "MyMiner",

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python2.7
import urllib
import urllib2
import json
import subprocess
import time
@@ -36,8 +36,8 @@ for algo in performance:
performance[algo]["cmd"]=performance[algo]["cmd"].format(ADDR=payment_addr, MINER=miner_name)
# fetch data from public APIs
exchrate=float(json.loads(urllib.urlopen("https://api.coinbase.com/v2/exchange-rates?currency=BTC").read())["data"]["rates"][currency])
rawrev=json.loads(urllib.urlopen("https://api.nicehash.com/api?method=simplemultialgo.info").read())["result"]["simplemultialgo"]
exchrate=float(json.loads(urllib2.urlopen("https://api.coinbase.com/v2/exchange-rates?currency=BTC").read())["data"]["rates"][currency])
rawrev=json.loads(urllib2.urlopen("https://api.nicehash.com/api?method=simplemultialgo.info").read())["result"]["simplemultialgo"]
# calculate our profitability
profit={}
@@ -83,7 +83,7 @@ if (current==0):
if (current==0):
# log a change
algo_log=open("algo-log", "a")
algo_log.write(str(datetime.datetime.now())+": "+max_profit_algo+"\n")
algo_log.write(str(datetime.datetime.now())+": "+max_profit_algo+" (*) "+format(max_profit_val, ".8f")+" "+format(max_profit_val*exchrate, ".2f")+"\n")
algo_log.close()
if (other==1):
# kill existing miners