/src

Tags: Bitcoin Trading Haskell Nix Docker

Primary LanguageHaskell

21it

Open source projects

Packages

  • reckless-trading-bot Bitfinex bot for automated trading (reckless)
  • bitfinex-client Bitfinex client API library for Haskell

Configuration

Configure Bitfinex user data:

vi ~/.profile

export BITFINEX_API_KEY="SECRET"
export BITFINEX_PRV_KEY="SECRET"

Quickstart

Requirements:

  • Running Docker/Swarm
  • On Mac you also need brew install coreutils wget

Run the following command to spawn reckless-trading-bot using prebuilt binaries from github:

./nix/ds-setup.sh --prebuilt

In case where you don't have initialized docker swarm (for example you never used it), you need to run:

./nix/ds-setup.sh --prebuilt --reset-swarm

To build reckless-trading-bot from source, make sure Docker have access to reasonable amount of resources (at least 8GB of memory, reasonable storage and CPU capacity). Initial compilation will take a lot of time, CPU, memory, bandwidth and storage, but it's needed to be done only once. Run the following command to build reckless-trading-bot from source and run it:

./nix/ds-setup.sh

You can review and change reckless-trading-bot settings in ./build/docker-compose.21it.yml file. Also take a look at the various utility shell scripts in the ./nix/*.sh location to manage bot and its data.

Development

Spawn nix-shell:

./nix/shell.sh

Everything following is supposed to be run from inside of spawned nix-shell. Run IDE:

vi .

Run tests:

stack test --fast --file-watch bitfinex-client

Run specific test:

stack test --fast --file-watch --test-arguments="-m platformStatus" bitfinex-client

Run development daemon:

ghcid

Release

Create new release:

git tag v0.1.0
git push --tags

Delete existing release:

git tag -d v0.1.0
git push --delete origin v0.1.0