Documentation

How To

Install the project:

As requirement for Binance you would need to include and compile this project https://github.com/binance-exchange/binance-java-api follow the instructions detailed in the site but as quick intro would be:

git clone https://github.com/binance-exchange/binance-java-api
cd binance-java-api
mvn clean install

As alternative you can also find the .jar under the root folder libs/

After those steps you will be ready to checkout gara-quant:

git clone https://github.com/GaraQuant/gara.git
cd gara
mvn clean  install package -Pproduction

Note that -Dproduction will minified all the fronted related files.

How to run the project

In order to do all in the easy way and automatically the better approach would be to create a service as it is described bellow:

Create this file:

vim /etc/systemd/system/garaquant.service

And add this content:

[Unit]
  Description=Example service from Gara Quant
  BandsAfter=syslog.target
[Service]
  User=ubuntu
  WorkingDirectory=/home/ubuntu/platform
  ExecStart=/usr/bin/java -Xms3000M -Xmx3000M -Dvaadin.productionMode -Dfile.encoding=UTF-8 -classpath "target/lib/*" gara.core.StrategyStarterStandard
  Output=journalStandard
  Error=journalSyslogIdentifier=aws-platform
  SuccessExitStatus=143
[Install]
  WantedBy=multi-user.target

reload all the services:

sudo systemctl daemon-reload

To start the service type:

sudo service garaquant start

Settings

We can find the configuration file in two different places. First inside of the core with the default and necessary settings src/main/resources/application.yml the file will be load in first place. As second place would be inside of the strategy itself located in src/main/resources/config/application.yml this file will overwrite the parameters existing in core.

strategy:
   #assets to show in the dashboard
   assets:
    - BTC
    - ETH

  # for simulation mode
  simulation:
    #enabled a simulation mode wrapping your exchange
    enabled: true | false
    #commission on simulation mode per transaction
    commission: 0.03

  exchanges:
   # Cyptonomics binance account
   - exchangeEnum: BNC
     apiKey:
     secretKey:
     #Different periods where it to trade
     periods:
       - fifteen_minutes
     #Securities by security name
     securities:
       #USDT
       - symbol: BCHSVUSDT

Configure SSL:

Certificate:
$ git clone https://github.com/certbot/certbot
$ cd certbot
$ ./certbot-auto --help
$ ./certbot-auto certonly -a standalone -d
$ openssl pkcs12 -export -in fullchain.pem -inkey privkey.pem -out keystore.p12 -name tomcat -CAfile chain.pem -caname root
Spring config:
server:
  port: 8443
  ssl:
    key-store: /etc/letsencrypt/live//keystore.p12
    key-store-password:
    keyStoreType: PKCS12
    keyAlias: tomcat