Skip to content

Commit

Permalink
Documentation Updates
Browse files Browse the repository at this point in the history
* Trim down the README and move the bulk of it into the Wiki, where we can make use of having multiple pages.
* Add a CONTRIBUTING.md document.
  • Loading branch information
scionaltera committed Apr 27, 2019
1 parent d599106 commit ee31e68
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 57 deletions.
48 changes: 48 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Contributing to Arbitrader
Thanks for your interest in contributing!

First of all, please feel free to propose changes to any part of the Arbitrader project with a pull request. If you have questions or have found a bug, please open an issue.

## What Can I Contribute?

### Report Bugs, Suggest Features

#### Before Opening an Issue
Be sure to check the open issues first, to make sure there isn't one that covers the bug you have found.

#### Writing a Good Bug Report
* **Use a short, clear, descriptive title.** Keep it crisp and unique so it's easy to know what the problem is from reading the title.
* **Describe the steps to reproduce** the problem. Include relevant parts of your configuration file (but **NOT** your API keys!) and your log messages that show any errors or stack traces.

#### Writing a Good Feature Request
* **Use a short, clear, descriptive title.** Keep it to a phrase that gives the gist of what your request is.
* **Clearly explain the need** for your new feature. Why would it help? What problem does it solve? In what ways would it help you?
* **Describe how it would work.** What does it do? Does it need any new configuration?

#### After Opening an Issue
Be prepared to discuss your issue, and be open to suggestions or alternatives. The project maintainer(s) reserve the right to accept or reject suggestions based on how they align with the project vision.

### Add Exchanges
Testing new exchanges is always useful. If you have added a new exchange and it works for you, please consider submitting a pull request back to the project so others can use it too. Here's a quick checklist of what you need to do.

#### How to Add a New Exchange
1. Add the new exchange dependency in `build.gradle`.
1. Add the configuration for the new exchange in `application.yaml`.
1. Compile, run and watch the bot make some trades using the new exchange.
1. Once you are confident that it is working correctly, submit a pull request.

#### What Goes in the Pull Request
1. The new dependency in `build.gradle`.
1. An example configuration in `application.example.yaml` with good descriptions of any unusual parameters (e.g. the "passphrase" for Coinbase Pro). **DO NOT** include your API keys!
1. Any other code you had to change to make the exchange work.

### Pull Requests
Adding new features, fixing bugs and updating documentation is always appreciated. A good pull request will have the following elements.

1. Work in your own fork in a branch, not `master`.
1. Write a detailed explanation of the pull request when you create it.
1. Try to match the code style of the existing code as best as you can.
1. Include documentation if...
* You added a new feature that has no existing documentation.
* You changed behavior that is already documented, making the existing docs incorrect.
1. Include tests that cover the code you changed.
63 changes: 6 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ Arbitrader is a program that finds trading opportunities between two different c

The software is MIT licensed, so you are free to use it as you wish. Please keep in mind that trading cryptocurrencies carries a lot of inherent risk, and unattended automated trading can add even more risk. The author(s) of Arbitrader are not responsible if you lose money using this bot. Please be patient and careful!

## How do I use it?
Please see the [wiki](https://github.com/scionaltera/arbitrader/wiki) for detailed instructions on running and using Arbitrader.

## Finding Help and Contributing
Contributions are always welcome! Please see [CONTRIBUTING.md](https://github.com/scionaltera/arbitrader/blob/master/CONTRIBUTING.md) for details on how to contribute.

## How does it work?
The trading strategy itself is inspired by [Blackbird](https://github.com/butor/blackbird). Arbitrader uses none of Blackbird's code, but a lot of the algorithms are similar.

Expand Down Expand Up @@ -107,60 +113,3 @@ $627.50 - $472.50 = $155.00 total profit, minus any fees.
We survived an unexpected major market shift and came out ahead in the end. Not bad!

Obviously this is a contrived example with fake numbers. Your mileage will vary, but hopefully that illustrates the principle at work in the strategy. If you still aren't convinced, Blackbird has an [issue thread](https://github.com/butor/blackbird/issues/100) that goes into a huge amount of detail and is well worth the read.

## How do I use it?

### Configuration File

Arbitrader uses a configuration file called `application.yaml`. There is an example file in the project, but you will need to fill in which exchanges you want to use, and some other parameters. When you run Arbitrader, just make sure the configuration file is in the directory you run the bot from, and the program should read it in. If no configuration can be found, you'll get an error saying Spring couldn't start up.

### XChange

Arbitrader uses the [XChange](https://github.com/knowm/XChange) library to access the various exchanges. Not all exchanges support all the features Arbitrader requires, and not all of them have been added as dependencies to the project yet. If you want to try an exchange that isn't a dependency, please add it to `build.gradle` and feel free to submit a pull request with your change.

If the bot doesn't work with the exchange(s) you want, you may need to implement the missing functionality in the XChange project and submit a pull request there.

### How to Run the Bot

The easiest way to run Arbitrader without any programming is through [Docker](https://www.docker.com/get-started). If you don't already have it, go ahead and install Docker on your machine. This project includes a Docker Compose file, so you can get up and running in just a few steps:

1. Install Docker if necessary.
1. Clone the project from GitHub.
1. Create your `application.yaml` based on `application.example.yaml`.
1. Run `docker-compose up` to start the bot.

If everything works properly you'll see Docker download the container and some log messages as it reads your configuration file and connects to the exchanges. Once you see the "Started Arbitrader..." message you won't see any further messages until it finds a trading opportunity.

#### Windows Users

In Windows `docker-compose` does not understand the `${PWD}` environment variable and will not turn it into the current working directory automatically. A workaround is to create a file called `.env` (TIP: Name it `.env.` in the Save... dialog!) in the same directory as you are running Arbitrader in with one line of configuration that points to Arbitrader's directory:

```
PWD=C:\absolute\path\to\arbitrader\directory
```

Adding the aforementioned configuration will set the `${PWD}` variable to the hard coded value that you picked.

### Developing
#### Compiling
Arbitrader is a Java project and uses the Gradle wrapper. You just need to have a Java 8 JDK on your machine. Clone the project and run the following to compile it:

```
./gradlew clean build
```

#### Running
If it compiles successfully it will build an executable JAR file in `build/libs` as well as a Docker container named `scionaltera/arbitrader:latest`. There is a `docker-compose.yaml` in the project's main directory, so the easiest way to start it up is:

```
docker-compose up
```

When the bot starts up you will see a banner and some log messages while it reads the configuration from `application.yaml` and connects to the exchanges. Once the initialization is done it will probably do nothing for awhile, while it searches for trade opportunities.

#### Debugging
You can connect a remote debugger to the running Docker container from your IDE (I use IntelliJ IDEA) by connecting it to `localhost:5005`. That will let you set breakpoints and step through the code as it runs.

### Finding Help and Contributing

If you have a question or find a bug, please feel free to submit an issue on GitHub. Pull requests are always welcome.

0 comments on commit ee31e68

Please sign in to comment.