Documentation

Networking, Nexus

Update OrderStatus:

Retrieve all the orders from the exchange. It is useful if for something we lost some info in db and we need to regenerate it. From a base asset, we will get the orders or all its pairs, example base asset BTC, will get ETHBTC, ADABTC,…

-Dspring.profiles.active=updateOrderStatus

Also is needed to indicate the securities to use as parameters

ETH BTC ..
Update Positions:

Takes all the order_status in db and with them it tries to generate all the positions and transaction, from the beginning to the end This command is useful in combination with updateOrderStatus in case that we need to populate all the data.

-Dspring.profiles.active=updatePositions
Historical Data:

Retrieve ticks or bars from coinapi, https://coinapi.io useful in combination with “simulation” command in other to test a strategy. All the info is same in Influx DB

example use:

-Dspring.profiles.active=historicalData  -duration 1h -startDate=2019-01-01 -limit=100
Simulation:

Backtesting, will take a file from resources/data/ with a historical ticks and run a simulation. It will read the cvs and calculate the bars and ticks. To see the result of the simulation you would need to open the UI and visit the tab Statistics.

-Dspring.profiles.active=simulation BTCUSDT ...

Csv format

time_close, price_close, price, exchange, symbol
1496270100, 2192.000000000000, 0.000000000000, BNC, btcusdt
...

if you need to add a new column to the cvs here there is a small script that can help you out:

import csv

"""
The actual format of the cvs is:

time_close,price_close,price
1496270100,2192.000000000000,0.000000000000

this script add a new column with the exchange from where is coming the data.

"""
with open('data/btcusdt.csv', 'r') as csvinput:
    with open('data/btcusdt_new.csv', 'w') as csvoutput:
        writer = csv.writer(csvoutput)
        for row in csv.reader(csvinput):
            writer.writerow(row + ["BNC"])

find more scripts in this repository:

Liquibase

Will update the db to the last version, note that all the migrations are under core/src/main/resources/liquibase/changelog to run liquibase would be necesary to add:

-Dspring.profiles.active=liquibase
Swagger Documentation

If you use this profile and swagger documentation will be generated, note that you will see this log while the platform is starting.

11:52:54.815 [main] INFO  springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator - Generating unique operation named: findAllUsingGET_1
11:52:54.835 [main] INFO  springfox.documentation.spring.web.readers.operation.CachingOperationNameGenerator - Generating unique operation named: findAllUsingGET_2
....

After platform loading is complete would be possible access to

https://app.gara-quant.com:8080/swagger-ui.html

Production

Will enable a JavaScript compression for the UI and also a ssl, note that in application.yml there are the following properties:

---
spring:
  profiles: production
server:
  port: 443
  ssl:
    key-store: /etc/letsencrypt/live/app.gara-quant.com/keystore.p12
    key-store-password:
    keyStoreType: PKCS12
    keyAlias: tomcat

key-store, would be the path where the certificates were generated, as example we use Let’s encrypt to generate all the certificates, check this entry