-
-
Notifications
You must be signed in to change notification settings - Fork 47
Using Arbitrader
Arbitrader uses a configuration file called application.yaml
. There is an example file in the project named application.example.yaml
that shows all the options and explains what they do. You will need to copy that file and fill in the configuration that you want. When you run Arbitrader the configuration file must be in the directory you run the bot from. If no configuration can be found you'll get an error saying Spring couldn't start up.
The easiest way to run Arbitrader is through Docker. 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:
- Install Docker if you don't have it already.
- Clone the project from GitHub.
- Create your
application.yaml
based onapplication.example.yaml
. - 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 may not see any further messages for awhile until it finds a trading opportunity.
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.
If you would rather run Arbitrader directly from the JAR file instead of using Docker you will need to compile the JAR yourself. Please see the Development Guide to learn how to build the JAR. After it is built you can execute it like this, replacing x.y.z
with the version number:
java -jar arbitrader-x.y.z-SNAPSHOT.jar
Running it this way is the hard way and our ability to support you is much more limited. Trust us, Docker is much easier.
When Arbitrader enters a trade it will write a JSON file in .arbitrader/arbitrader-state.json
with the details of that trade. If you need to restart the bot for any reason, such as to update to a newer version, it will read that file on startup and remember the open trades.
To stop Arbitrader simply hit Ctrl+C
and it will stop. If any trades were active they will be reloaded when you start it again the next time. Look for the log message as it starts up to be sure.
If something has gone wrong and you need to restart the bot due to an error, it may be necessary to delete .arbitrader/arbitrader-state.json
and log into your exchanges to close any open positions manually. In general the bot will prefer to "fail fast" and exit rather than compounding any problems it faces by trying to fix them automatically. This is a deliberate design decision to avoid making things worse once we already know something is wrong.