very useful hint, thank you very much
Just to add on that. Query from the pool you are using the current difficulty, hashrate, etc.
Official pool is:
http://45.32.171.89:8111/statsNow, you can calculate your profitabily as:
If you are mining x H/s
profit = hashrate * 86400 / stats['network']['difficulty'] * stats['network']['reward']
coins = profit / stats['config']['coinUnits']
Also, note 1KH/s = 1024 H/s, 1MHash = 1024 KH/s = 1024*1024 H/s and so on! Multiply by 1024 not 1000.
For example, suppose you are at 1KH/s (1024 H/s) then you've got (more or less at writing time this values are correct):
profit = 1024 * 86400 / 312742295 * 162898140711 = 4.60832614 * 10^10
coins = 4.60832614 * 10^10 / 100000000 = 4.60832614 * 10^(10-8) = 460 ITNS/day
(yeah, already at 300M difficulty...)
Now, you can query
https://stocks.exchange/api2/tickerAnd use ITNS ticker to find current change is 0.00000033 btc/ITNS, so
btc = coins * 0.00000033 = 460 * 0.00000033 = 0.0001518
You can even calculate the average block time (in seconds) on your current pool by:
estimate = stats['network']['difficulty'] / stats['pool']['hashrate']