Skip to content

confirm/CryptoBob

Repository files navigation

CryptoBob

CryptoBob is a radically simple crypto currency bot, which interacts with Kraken and…

  • … automatically buys crypto currencies on a recurring basis
  • … automatically withdraws crypto currencies when a threshold is reached

CryptoBob is your perfect little sidekick, when you want to automate the purchase and storage of crypto currencies on your hardware wallet / ledger. Of course there are services out there doing this, but usually Kraken has much better fees than those services, and a much better selection of crypto ;)

Installation

Install the package via PyPi:

pip3 install cryptobob

Install the package from source:

pip3 install cryptobob@git+https://git.confirm.ch/confirm/cryptobob.git

Linux service

CryptoBob can also be run as Linux service, for example via systemd.

To use CryptoBob as service, it's recommended to create a dedicated user, or to use your personal user for it.
Creating a new Linux user can be achieved as root by running these commands:

# Create new POSIX group
groupadd -g 666 cyrptobob

# Create new POSIX user
useradd -d /home/cryptobob -m -g 666 -u 666 cryptobob

Then install CryptoBob in a dedicated Python venv by running these commands:

# Change to new cryptobob user.
su - cryptobob

# Create new venv and activate it.
python3 -mvenv ~/.venv
source .venv/bin/activate

# Install CryptoBob
pip3 install cryptobob

The user needs to have access to the configuration file, documented in the Configuration chapter.

Is your configuration ready and CryptoBob installed, you can use the example systemd service unit to configure, start, and enable a systemd service:

# Download systemd service unit.
curl -Lo /etc/systemd/system/cryptobob.service https://raw.githubusercontent.com/confirm/CryptoBob/master/example/cryptobob.service

# Reload systemd daemon
systemctl daemon-reload

# Start and enable service
systemctl enable cryptobob
systemctl start cryptobob

HINT: Please note that if you've updated the cryptobob.service file, you need to run systemctl daemon-reload again.

Usage

The usage of cryptobob is quite simple:

usage: cryptobob [-h] [-c CONFIG] [-s] [-v] {run,buy,assets,otp}

CryptoBob - The bot which buys & withdraws crypto automatically.

positional arguments:
  {run,buy,assets,otp}        action to execute

options:
  -h, --help                  show this help message and exit
  -c CONFIG, --config CONFIG  path to the CryptoBob config
  -s, --simple                enable simple logging format (e.g. for systemd)
  -v, --verbose               enable verbose logging mode (repeat to increase verbosity, up to -vvv)

To display all assets listed on Kraken, you can run:

cryptobob assets

To run CryptoBob, you can simply execute:

cryptobob run -vv

To (force) buy / execute the configured trade plans, you can run:

cryptobob buy -vv

In case you configured OTP for your API key and want to get a one-time code, you can run:

cryptobob otp

Please note you've to configure CryptoBob accordingly.
Check out the next section for the configuration.

Configuration

By default, CryptoBob is searching its configuration file under ~/.cryptobob.yml.
Feel free to change the configuration file path by specifying the -c or --config CLI flag.

You can find an example configuration in the CryptoBob repository.

IMPORTANT: The configuration file contains sensitive informations. Make sure you set the permissions right!

Runtime data

Please note CryptoBob doesn't store any runtime data or alike on your system, since it will always use the Kraken order history as a reference for upcoming orders.

For example, when CryptoBob buys a certain asset on Kraken, it will open a new buy order. That buy order is then submitted, executed, and stored on Kraken. When CryptoBob then runs again, it will retrieve the last executed order for certain asset from Kraken, compare its order timestamp with your configured interval, and checks if enough time has passed to open another buy oder.

Of course, only orders initiated by CryptoBob will be queried for the timestamps (achieved via userref on ClosedOrders).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published