
Briefly profitable alt-coin mining on Amazon through better code - jterrace
http://da-data.blogspot.com/2013/12/briefly-profitable-alt-coin-mining-on.html
======
kasey_junk
I love the double standards on display at HN. In this whole thread, not a
single mention of the opportunity cost of smart people wasting resources on
things not productive to society or how it is an unfair market because someone
is taking advantage of the other participants by being more sophisticated than
them.

What would the discussion be like if the headline was "Briefly profitable HFT
FX trading through better code"?

~~~
chime
I think of research into virtual currencies as at least as beneficial as
GIMPS, SETI, Folding@Home. All of these have progressed CS in significant,
measurable ways. And if someday one of the many alt-coins or one of their
descendants becomes well established, all of this research would be worth it.

Also, while I am still unsure of the benefits of HFTs despite trying really
hard to understand how they bring liquidity by front-running etc., I still
think the technology invented to make HFT possible is a net-good for humankind
- GPUs that can perform trade in nanoseconds, processing happening on the same
layer as network traffic, entire CPU/GPUs living an inch from the ethernet
port. All of this stuff is really neat and even though the practice of HFT is
morally questionable, the fact that it pushes our capabilities further is not
something we can ignore.

The future world will be a much better place if I can wire $2k to my dad in
India without going through multiple banks, wire-transfer fees, proof of
citizenships etc. Better that we work for a world where money is not
controlled by the powerful than make better shiny reports for sales and
traffic analysis for mobile.

~~~
roel_v
"I think of research into virtual currencies as at least as beneficial as
GIMPS, SETI, Folding@Home."

LOL. The cognitive dissonance is strong with this one. Also, mining bitcoins
or squeezing a few extra cycles out of a VM is not 'research into virtual
currencies'. Look people, let's just call a spade a spade here - us nerds are
quite happy with our new-found economic powers (not just BC, in general), and
we're all too happy to flex it when new tech (like BC) gives us an early mover
advantage. Yeah I'm bitter I'm no BC millionaire because I had other things on
my hands 2 years ago than running some software, while I did run SETI@HOME on
a largish network for a long time a decade ago for no gain at all; but 200
years ago I would have been a peasant, now I was catapulted into upper middle
class just because I was born in the right decade and with that twist in my
mind that makes me grok computers better than most people. That's just how it
is, why do feel we need to make moral justifications about it (or worse, whack
job 'I deserve it because I worked harder' delusions like in that article
yesterday about the Google dude).

------
AdamMeghji
I also used this brief window of opportunity as a fun experiment in learning
Ansible. As a result, I've published a repo which automates setting up LTC
mining on g2.2xlarge instances.

[http://github.com/adammeghji/ansible-ltc-mining-on-
ec2](http://github.com/adammeghji/ansible-ltc-mining-on-ec2)

If anybody's curious to spin up a GPU instance and dabble with this, this
greatly facilitates downloading, compiling, and installing the CUDA drivers,
and setting up the LTC miners. Amazon has a $100 credit available too, if the
current spot instance prices are prohibitive.

~~~
suchusername
I used your script to help me figure out how to dig for DogeCoin. Ultimately I
wound up doing everything on Screen. Did 1, 3, 5, and finally 1 instances, a
few hours at a time. I've stopped mining for now, going to wait until I set up
my own rig and maybe create a new AltCoin.
[https://gist.github.com/benatkin/7868889](https://gist.github.com/benatkin/7868889)

------
throwaway0094
So: 1.5 weeks of work. $50-$75/mo/instance. x20-60 instances. Worked for 3-4
weeks.

If we assume the most optimistic parameters: $75 * 1mo * 60 instances = $4500
in profit for 1.5 weeks of work, or a rate of ~$156k/yr.

Edit: It looks like I misread his revenue numbers for profit. Oops! Even lower
margins:

"My gross revenue was about $1000, and I paid Amazon $500 of that."

$500 for 1.5 weeks' work is only $17k/yr rate. Maybe flipping burgers pays
better.

~~~
Aqueous
Well, if he just leaves this running, assuming the same level of profitability
it is 17k a year of passive income...definitely worth keeping up if possible.
as the exchange rate goes up it should become even more profitable.

~~~
throwaway0094
As others have pointed out, this is not remotely passive.

~~~
Aqueous
With enough automation it could become passive. Then again with enough
automation everything becomes passive.

~~~
sliverstorm
The problem is with cryptocoins, the window of opportunity is always small,
short, and never comes again- you have to find an entirely new window.

Much like with most forms of arbitrage, and exploitable patterns in the stock
market. You discovery the opportunity, you make a little $$, and the hole
quickly closes as everyone else capitalizes on it too.

------
jordanthoms
I've been mining on my AMD 290x for the past few days - I brought it for
gaming, so I don't need to get a return on the hardware, and the heat
generated is useful too - it keeps my apartment a little warmer. Looking at a
profit of around $8 per day at current difficulty, which is a pretty cheap
heating solution!

~~~
driverdan
I just bought 3 290x cards for this purpose. Right now they pay for themselves
in 2 months.

~~~
jordanthoms
It's certainly more risky when you are buying hardware only to mine - although
I guess that is bounded by the fact that even if FPGA or ASIC miners were to
make it unprofitable, the GPUs are still valuable and you can sell them.

~~~
driverdan
Yes, there is risk in buying dedicated hardware but the risk is quite
reasonable. The R9 290x GPUs are brand new and in high demand. If for some
reason the altcoin market collapses I can sell them close to their original
cost.

------
infruset
I wonder how many people have custom improved mining software and using it as
a competitive advantage.

~~~
dgacmu
It's a good question. In the case of these nvidia cards, it doesn't seem
worthwhile: If you're seriously mining for money and buying hardware, you're
still better off buying the AMD GPUs. I don't know if there's similar room for
improvement on the OpenCL mining code, but it seems like it gets more
attention.

~~~
infruset
Maybe it's not worthwhile for Bitcoins or Litecoins, but how about the smaller
altcoins for which a competitive advantage early on can have a big impact?

------
HorizonXP
I'm currently doing this right now with 30 instances. I'm currently operating
at about 7 MH/s. At current rates, it's not exactly "profitable", but I'm
using up some AWS credit that I have. I don't intend to sell the LTC until it
hits about 40 or maybe 50, but in any case, it's still all profit for me,
other than the fact that I lose out on the AWS credit for other uses.

Edit: I'm also not paying $6/hr... That would be absurd. I'm not unprofitable
by much.

~~~
ugexe
Everyone is using $100 ec2 credits for coin mining, that's why everyone is
overpaying for spot price at the moment

~~~
HorizonXP
I have much more than $100. Hence why I'm even bothering.

------
edgesrazor
I'd been doing my own research on viability of mining on Amazon, and I posed a
question on the AWS forums asking how it's possible the spot prices could be
going so high. There's instances going anywhere from 5-20 times their On-
Demand prices. At this time, no one's answered it, so if anyone here knows,
I'd love to hear why someone would pay $10.00 per hour for an instance they
can get On-Demand for $2.40.

~~~
michaelt
One pricing strategy I've heard of goes like so:

No rational person would bid above the on demand price, so the spot price will
never rise above the on demand price. Therefore if I bid just above the on
demand price I'll never be outbid, and I won't have to deal with automating
the switch from spot to on demand instances.

Needless to say, this logic is wrong.

~~~
edgesrazor
Funny you should mention that. There was a blog post I had read where they
were discussing an unfortunate AWS customer who bid $999.00/hour for Spot
instances thinking it would protect their running servers from shutting down.
Little did this person realize, Amazon - unlike eBay - doesn't just accept the
next highest bid, they accept THE highest bid. They were running a Spot
instance for an entire month at $999/hour. Ouch.

~~~
zwily
That's not true - the price you set is the max price you're willing to pay. If
your price is higher than the current spot price, you pay the current spot
price. The blog post author must be mistaken somehow.

------
zwily
AWS is adding an upper limit to spot price bids of 4X the on-demand cost, as
of December 20:

[http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-
spo...](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-
limits.html)

This may be in response to some of the crazy bids we've seen on the spot
market since people started using it for mining.

------
tobias2014
"With the increase in scrypt coin prices, the load on the mining pools
increased, and most began experiencing frequent outages."

He should have used p2pool.

~~~
HorizonXP
That's what I've been using.

------
KVFinn
Is it just a quirk of the GPU architecture that Nvidia can't mine as well as
AMD or it a problem with their cards?

~~~
dgacmu
AFAICT, it's a result of their internal architectural decisions vs. the
structure of some of these crypto operations. The simplest example is that AMD
offers a hardware bit rotate instruction and NVidia doesn't. (The newer
compute_35 devices have a funnel shifter that gets halfway there, but it
requires using a 64 bit op, which is still slower).

But beyond that, for scrypt, AMD has an internal architecture that encourages
using a internal 4-wide vector ops (the key being that threads in a stream can
diverge and the scheduler handles them, but the vector ops are strictly
locked). This seems to give them an advantage in several "stupidly parallel"
workloads that consist of basic operations in huge parallel, whereas Nvidia's
architecture regains ground when the control flow/etc., becomes a bit more
complicated. But calculating 64k SHA-2 or scrypt hashes in parallel doesn't
stress the thread scheduler or divergence handling at all. Also, scrypt
internally does well when you parallelize it into groups of 4 uint32's -
that's actually the key optimization I added to my version of the miner.
Which, again, maps quite nicely to AMD's preferred optimization path.

------
cypherpunks01
So _this_ explains why spot prices have been through the roof the past few
months!

~~~
sliverstorm
Only on the g2 instances though, I believe.

~~~
bowyakka
the other high cpu and gpu instances too

