Skip to main content

Automated trading bot for DCA crypto investments

Project description

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).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cryptobob-1.4.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file cryptobob-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: cryptobob-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.20

File hashes

Hashes for cryptobob-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1f441ee25f0daa007fcfa57c7387d5cc9f75224189a1d7e87a2de353cec1634
MD5 964b1ab9e61b8390c506c3295a8023ab
BLAKE2b-256 910c04fdf858eff97a62c5c78c4c7e8e389e370868dfdbe68267cd7eaea24b34

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page