Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Running a Yield Generator

chucklesmcgee edited this page Aug 11, 2016 · 43 revisions

Yield generator is a JoinMarket bot which does market-making of CoinJoins to produce an income. The bot connects to the JoinMarket trading pit on an IRC channel, announces its offers and waits. Market takers will communicate with it to create a CoinJoin transaction.

A few words

First thing to understand is that this is not a bank account with a guaranteed interest rate. You are selling a product, namely coinjoins, and your customers can take it or leave it depending on your offered fee, range of available coinjoining, internet speed, latency and so on. Most of the actual decision-making is done by software bots rather than humans but the same principles apply. The algorithm for market takers remembers yield generators they previously dealt with and avoid those who did not offer a good experience. You have an incentive to be on your best behavior.

###Things to Avoid

  • Not using Bitcoin Core with JoinMarket. Using a method that queries a third-party server (like blockr.io or electrum servers) is slower, is more likely to hang or crash and generally makes the user experience worse. It also reveals your addresses to the server operator!
  • Slow, flaky internet connections. CoinJoins require multiple people to take part, if one yield generator times-out or is slow, the entire process is held up or must be restarted. The entire point of a market maker is to offer a deal immediately, without any waiting or hold-ups.
  • A small range of coinjoin amounts. If you can only offer from zero to 10000 satoshi, you're unlikely to get many coinjoin deals.
  • Not updating often enough. This software is still in the very early stages. Keep an eye out of updates.

Requirements / How-to

You will need to:

  • Install JoinMarket.
  • Create and name a Joinmarket wallet using the command: python wallet-tool.py generate
  • List the addresses (/chris-belcher/joinmarket/wiki/Using-the-JoinMarket-internal-wallet#funding) held in this newly created Joinmarket wallet using the command python wallet-tool.py yournewwallet.json where "yournnewallet" is the name of the wallet you just created. Note a bitcoin address in the 0th level.
  • Send some Bitcoins to the address you noted. The more the better, as larger wallets are more scarce and can command a higher fee.
  • Configure a Bitcoin full node to use Joinmarket.
  • Edit the yield-generator-*.py variant of your choice for your desired fees, then run this variant yield-generator.py on a permanently-on computer with a stable internet connection.
  • Wait and be patient.

Running

Open one of the files called yield-generator-*.py in a text editor and edit the configuration. Currently these are the fields. Most of them can just be left at the default values.

txfee = 1000
cjfee = '0.002' # 0.2% fee
nickname = random_nick()
nickserv_password = ''
minsize = int(1.2 * txfee / float(cjfee)) #minimum size is such that you always net profit at least 20% of the miner fee
mix_levels = 5

Meaning of fields:

  • txfee. The yield generators contribution to the miner fee. Too low and your coins may be locked up unconfirmed for some time. Too high and your earnings will be low.
  • cjfee. Your offered coinjoin fee as a fraction of the coinjoin amount. Takers pay this to you.
  • nickname. Your IRC nickname. Leaving as the default random_nick() is fine.
  • nickserv_password. Used if you've registered with NickServ. Leave empty to skip login.

When you're ready simply run the yield-generate.py script with the wallet file as argument.

python yield-generator.py my-wallet-file.json

I deposited X btc into yield generator, why is it only offering Y (< X) btc in the market?

Short answer: privacy

Long answer: https://bitcointalk.org/index.php?topic=919116.msg11465848#msg11465848

Modifying the algorithm

If you are a programmer you could try creating your own algorithm for the yield generator.