Bitcoin Forum
May 27, 2024, 03:16:06 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Coin Profitability Calculator  (Read 2731 times)
salfter (OP)
Hero Member
*****
Offline Offline

Activity: 651
Merit: 501


My PGP Key: 92C7689C


View Profile WWW
May 22, 2013, 09:15:21 PM
Last edit: May 06, 2014, 08:28:26 PM by salfter
 #1

Is that altcoin you're considering more profitable than what you're currently mining? http://dustcoin.com/mining and http://www.coinchoose.com/ have some altcoins listed, but not all of them.  (For instance, neither of them have Yacoin listed.)  This little app I knocked together will tell you how much to expect:

https://dl.dropboxusercontent.com/u/57535575/CoinProfitability.zip

It needs these to do its calculation:

  • interval over which to calculate (in seconds...86400 to calculate for a day)
  • your expected hashrate
  • the chain's current block reward
  • the current difficulty
  • (optional) exchange rate to get BTC for your altcoin

You most likely know your hashrate for SHA-256 and scrypt coins.  Difficulty is available from most block explorers.  Pools usually have the block reward available. Get the exchange rate from your favorite exchange; if you're calculating Bitcoin profitability, you can leave it blank or set it to 1.

You can now add configuration information to the registry for your favorite coins.  Example configs for several coins are included.  Adding others as you need them should be easy.  You can pull exchange rates from either Bter or Cryptsy (depending on whether they support the coin you want to exchange). Difficulty and reward information can be pulled from blockchain.info (for Bitcoin), most Abe implementations (for other coins), or from CoinChoose (for the coins it supports).

I built this in Visual Studio 2012 Express against .NET Framework 4.0 (needed that version because it's the first that includes BigInteger support).  I've also tested it under Mono; its implementation of Decimal.ToString() is a bit different and needed some adjustment.  Source code is also available...there really isn't much to it:

https://github.com/salfter/CoinProfitability/

Gnu.Getopt is needed to compile the CLI version:

http://getopt.codeplex.com/

Note: Exchange rates might not get looked up properly when running under Mono on Linux.  I might need to switch to a different JSON parsing library to make this work. I got rid of the dependency on JSON.NET that kept the calculator from running on Linux; it now uses .NET's JavaScriptSerializer class.

Update: (6 May 2014) Since scraping coin explorers is getting somewhat iffy, you can now use CoinChoose to get difficulty and reward information for the coins that are listed there.  Also, the library buffers data received from CoinChoose and Cryptsy for reuse, which speeds things up when you're (for instance) using the CLI to list all coins.

Update: (1 April 2014) Not an April Fools' joke: the CLI client has a new option to dump info on all coins.  Maybe this will run faster on the Raspberry Pi and similar resource-starved environments.

Update: (28 March 2014) Lots of changes.  First, Cryptsy changed the API URL a while back, but I hadn't updated this program. Also, the Litecoin explorer now returns block difficulty in the table on its homepage, simplifying data retrieval for that coin. I've also improved exchange lookup at Cryptsy...instead of downloading the entire orderbook on each call, it can download just the orderbook data for the currency in question.  Finally, proof-of-stake coins are handled properly: with Abe-compatible block explorers, we make sure we're pulling reward and difficulty information from the most recent proof-of-work block.

Update: (31 May 2013) A CLI version is now available for use in your scripts, as well as a DLL you can include in your own .NET (or Mono) projects.

Update: (4 June 2013) Cryptsy decided to start polluting its JSON with HTML...workaround applied.

Update: (4 June 2013, the second) Turns out that Cryptsy has an API now...that allows me to get rid of a bunch of cruft.

Update: (11 June 2013) Updated default config for more reliable operation, and added a Feathercoin config.

Update: (12 June 2013) Fixed a bug in which non-integer rewards caused an incorrect calculation, and added a Bitbar config.

Tipjars: BTC 1TipsGocnz2N5qgAm9f7JLrsMqkb3oXe2 LTC LTipsVC7XaFy9M6Zaf1aGGe8w8xVUeWFvR | My Bitcoin Note Generator | Pool Auto-Switchers: zpool MiningPoolHub NiceHash
Bitgem Resources: Pool Explorer Paper Wallet
sal002
Hero Member
*****
Offline Offline

Activity: 490
Merit: 500


View Profile WWW
May 22, 2013, 09:42:18 PM
 #2

Nice work Smiley  FYI, I don't have Yacoin since you can't use a GPU to mine it...

But always good to see innovation!
salfter (OP)
Hero Member
*****
Offline Offline

Activity: 651
Merit: 501


My PGP Key: 92C7689C


View Profile WWW
May 22, 2013, 10:23:02 PM
 #3

Nice work Smiley  FYI, I don't have Yacoin since you can't use a GPU to mine it...

I'm pretty sure that was the whole point behind Yacoin. Smiley FWIW, I have it mining on my VPS (8 cores, Xeon E5-2670, Gentoo Linux x86) and one of my computers at home (4 cores, Core 2 Quad Q6600, Gentoo Linux AMD64).  The VPS delivers about 28 kH/s; the other box does 40.  At current rates, it's a little bit better than Litecoin mining, which means I should probably take it off my home machine (for which I'm paying for power) and leave it on the VPS.  28 kH/s at current difficulty yields about 3.3 YAC per day...or about BTC0.00142...or about $0.17.  The way I look at it, it'll knock about $5 per month off of the cost of having the VPS.  It's running at lowest priority, so it doesn't interfere with the VPS's primary task.

It could take some usability improvements...

...which are now in place:

https://github.com/salfter/CoinProfitability/commit/d0b3b9bf31f98de1d95b54034e665da717dfc01a

The binary available for download in the OP has been updated as well.

Tipjars: BTC 1TipsGocnz2N5qgAm9f7JLrsMqkb3oXe2 LTC LTipsVC7XaFy9M6Zaf1aGGe8w8xVUeWFvR | My Bitcoin Note Generator | Pool Auto-Switchers: zpool MiningPoolHub NiceHash
Bitgem Resources: Pool Explorer Paper Wallet
sal002
Hero Member
*****
Offline Offline

Activity: 490
Merit: 500


View Profile WWW
May 22, 2013, 10:29:33 PM
 #4


I'm pretty sure that was the whole point behind Yacoin. Smiley

True - so I think it matters in comparison geared towards CPU miners Smiley
Hydroponica
Full Member
***
Offline Offline

Activity: 182
Merit: 100


fml


View Profile
May 22, 2013, 10:30:50 PM
 #5

Any plans for API support?

gnomicide
Full Member
***
Offline Offline

Activity: 122
Merit: 100


View Profile
May 22, 2013, 10:34:17 PM
 #6

YAC should only be there if it has a separate expected hashrate. I remember seeing it briefly on CoinChoose and it sure looked profitable!
salfter (OP)
Hero Member
*****
Offline Offline

Activity: 651
Merit: 501


My PGP Key: 92C7689C


View Profile WWW
May 22, 2013, 11:39:02 PM
Last edit: May 31, 2013, 09:18:22 PM by salfter
 #7

Any plans for API support?

If you mean automated retrieval of some of the needed stats, it isn't something I had planned on...but it would be nice.

Edit: Recent releases have this capability.  Configurations for some of the coins I've mined lately are included.  Adding others is fairly straightforward.

Tipjars: BTC 1TipsGocnz2N5qgAm9f7JLrsMqkb3oXe2 LTC LTipsVC7XaFy9M6Zaf1aGGe8w8xVUeWFvR | My Bitcoin Note Generator | Pool Auto-Switchers: zpool MiningPoolHub NiceHash
Bitgem Resources: Pool Explorer Paper Wallet
salfter (OP)
Hero Member
*****
Offline Offline

Activity: 651
Merit: 501


My PGP Key: 92C7689C


View Profile WWW
May 29, 2013, 04:51:38 PM
 #8

YAC should only be there if it has a separate expected hashrate. I remember seeing it briefly on CoinChoose and it sure looked profitable!

When I checked yesterday, it was about 3x more profitable than Bitcoin for my VPS.

Tipjars: BTC 1TipsGocnz2N5qgAm9f7JLrsMqkb3oXe2 LTC LTipsVC7XaFy9M6Zaf1aGGe8w8xVUeWFvR | My Bitcoin Note Generator | Pool Auto-Switchers: zpool MiningPoolHub NiceHash
Bitgem Resources: Pool Explorer Paper Wallet
salfter (OP)
Hero Member
*****
Offline Offline

Activity: 651
Merit: 501


My PGP Key: 92C7689C


View Profile WWW
May 29, 2013, 06:51:21 PM
 #9

Any plans for API support?

Try the current release that I just uploaded.  I should probably come up with a configuration editor instead of having to use regedit, but it's still fairly straightforward.

Tipjars: BTC 1TipsGocnz2N5qgAm9f7JLrsMqkb3oXe2 LTC LTipsVC7XaFy9M6Zaf1aGGe8w8xVUeWFvR | My Bitcoin Note Generator | Pool Auto-Switchers: zpool MiningPoolHub NiceHash
Bitgem Resources: Pool Explorer Paper Wallet
salfter (OP)
Hero Member
*****
Offline Offline

Activity: 651
Merit: 501


My PGP Key: 92C7689C


View Profile WWW
May 30, 2013, 05:57:13 PM
 #10

...and a new release is available, now with support for Cryptsy as well as Bter for exchange-rate lookup.

Tipjars: BTC 1TipsGocnz2N5qgAm9f7JLrsMqkb3oXe2 LTC LTipsVC7XaFy9M6Zaf1aGGe8w8xVUeWFvR | My Bitcoin Note Generator | Pool Auto-Switchers: zpool MiningPoolHub NiceHash
Bitgem Resources: Pool Explorer Paper Wallet
salfter (OP)
Hero Member
*****
Offline Offline

Activity: 651
Merit: 501


My PGP Key: 92C7689C


View Profile WWW
May 30, 2013, 08:14:46 PM
 #11

JSON.NET is no longer used. As a result, CoinProfitability runs like a champ under Linux.  I might do a command-line version next; that would be useful for a coin-hopping script (for instance).  A new binary zipball is up on Dropbox; updated source is on GitHub.  See the OP for links.

Tipjars: BTC 1TipsGocnz2N5qgAm9f7JLrsMqkb3oXe2 LTC LTipsVC7XaFy9M6Zaf1aGGe8w8xVUeWFvR | My Bitcoin Note Generator | Pool Auto-Switchers: zpool MiningPoolHub NiceHash
Bitgem Resources: Pool Explorer Paper Wallet
salfter (OP)
Hero Member
*****
Offline Offline

Activity: 651
Merit: 501


My PGP Key: 92C7689C


View Profile WWW
May 31, 2013, 05:49:39 PM
Last edit: May 31, 2013, 09:29:56 PM by salfter
 #12

I might do a command-line version next; that would be useful for a coin-hopping script (for instance).  

...and it's done. A new binary zipball is up on Dropbox; updated source is on GitHub.  See the OP for links.  

One way you can use the CLI is to get a list of coin profitability percentages (needs bash and bc; Cygwin provides these on Windows):

Code:
btc_profit=$(profit.exe); for i in $(profit.exe -l); do echo -n $i": "; echo scale=2\; 100 \* $(profit.exe -bc $i) / $btc_profit | bc | tr -d "\n"; echo "%"; done

It'll produce output something like this:

Code:
bitcoin: 100.00%
litecoin: 96.80%
worldcoin: 118.01%

Tipjars: BTC 1TipsGocnz2N5qgAm9f7JLrsMqkb3oXe2 LTC LTipsVC7XaFy9M6Zaf1aGGe8w8xVUeWFvR | My Bitcoin Note Generator | Pool Auto-Switchers: zpool MiningPoolHub NiceHash
Bitgem Resources: Pool Explorer Paper Wallet
peonminer
Hero Member
*****
Offline Offline

Activity: 798
Merit: 531


Crypto is King.


View Profile
May 31, 2013, 05:54:26 PM
 #13

sub'd
salfter (OP)
Hero Member
*****
Offline Offline

Activity: 651
Merit: 501


My PGP Key: 92C7689C


View Profile WWW
June 04, 2013, 05:13:23 PM
 #14

Cryptsy decided to start polluting its JSON with HTML...workaround applied. A new binary zipball is up on Dropbox; updated source is on GitHub.  See the OP for links.  

Tipjars: BTC 1TipsGocnz2N5qgAm9f7JLrsMqkb3oXe2 LTC LTipsVC7XaFy9M6Zaf1aGGe8w8xVUeWFvR | My Bitcoin Note Generator | Pool Auto-Switchers: zpool MiningPoolHub NiceHash
Bitgem Resources: Pool Explorer Paper Wallet
sal002
Hero Member
*****
Offline Offline

Activity: 490
Merit: 500


View Profile WWW
June 04, 2013, 05:32:28 PM
 #15

Cryptsy decided to start polluting its JSON with HTML...workaround applied. A new binary zipball is up on Dropbox; updated source is on GitHub.  See the OP for links.  


You might want to look at the new Cryptsy API which has the ability to get the orderbook.   I switched to it.
salfter (OP)
Hero Member
*****
Offline Offline

Activity: 651
Merit: 501


My PGP Key: 92C7689C


View Profile WWW
June 04, 2013, 05:41:24 PM
 #16

Cryptsy decided to start polluting its JSON with HTML...workaround applied. A new binary zipball is up on Dropbox; updated source is on GitHub.  See the OP for links.  


You might want to look at the new Cryptsy API which has the ability to get the orderbook.   I switched to it.

Cryptsy finally has an API?  I'll need to look into that.

Tipjars: BTC 1TipsGocnz2N5qgAm9f7JLrsMqkb3oXe2 LTC LTipsVC7XaFy9M6Zaf1aGGe8w8xVUeWFvR | My Bitcoin Note Generator | Pool Auto-Switchers: zpool MiningPoolHub NiceHash
Bitgem Resources: Pool Explorer Paper Wallet
sal002
Hero Member
*****
Offline Offline

Activity: 490
Merit: 500


View Profile WWW
June 04, 2013, 05:51:53 PM
 #17

Yep - so does MCXNow  (if you want to add that exchange), that isn't too hard to use.  I can send you details.
salfter (OP)
Hero Member
*****
Offline Offline

Activity: 651
Merit: 501


My PGP Key: 92C7689C


View Profile WWW
June 04, 2013, 06:44:14 PM
 #18

The latest version now uses Cryptsy's new API to retrieve exchange data. A new binary zipball is up on Dropbox; updated source is on GitHub.  See the OP for links.  

Tipjars: BTC 1TipsGocnz2N5qgAm9f7JLrsMqkb3oXe2 LTC LTipsVC7XaFy9M6Zaf1aGGe8w8xVUeWFvR | My Bitcoin Note Generator | Pool Auto-Switchers: zpool MiningPoolHub NiceHash
Bitgem Resources: Pool Explorer Paper Wallet
salfter (OP)
Hero Member
*****
Offline Offline

Activity: 651
Merit: 501


My PGP Key: 92C7689C


View Profile WWW
June 11, 2013, 06:10:21 PM
 #19

Updated default config for more reliable operation, and added a Feathercoin config. A new binary zipball is up on Dropbox; updated source is on GitHub.  See the OP for links. 

Tipjars: BTC 1TipsGocnz2N5qgAm9f7JLrsMqkb3oXe2 LTC LTipsVC7XaFy9M6Zaf1aGGe8w8xVUeWFvR | My Bitcoin Note Generator | Pool Auto-Switchers: zpool MiningPoolHub NiceHash
Bitgem Resources: Pool Explorer Paper Wallet
salfter (OP)
Hero Member
*****
Offline Offline

Activity: 651
Merit: 501


My PGP Key: 92C7689C


View Profile WWW
June 12, 2013, 07:56:01 PM
 #20

Fixed a bug in which non-integer rewards caused an incorrect calculation, and added a Bitbar config. A new binary zipball is up on Dropbox; updated source is on GitHub.  See the OP for links. 

Tipjars: BTC 1TipsGocnz2N5qgAm9f7JLrsMqkb3oXe2 LTC LTipsVC7XaFy9M6Zaf1aGGe8w8xVUeWFvR | My Bitcoin Note Generator | Pool Auto-Switchers: zpool MiningPoolHub NiceHash
Bitgem Resources: Pool Explorer Paper Wallet
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!