This service is not suitable for any production usage. The purpose is to showcase the algorithm only. Data, that is used by the service, is packaged inside the jar itself.
- Java 11
To run unit and integration tests execute the following command:
./mvnw clean verify
Build an executable jar:
./mvnw clean package
Output jar will always have the same name service
. To run it, the following command can be used:
java -jar target/service.jar --server.port=8080
There is only one endpoint available POST /portfolios/rebalance
. It will run rebalancing process for all customers
and return status code 200
if operation was successful. An example of calling it using HTTPie:
http --verbose POST :8080/portfolios/rebalance
The result of the rebalancing will be available in the server logs. Rebalancing starts with message
Starting rebalancing of all portfolios
and ends with message Rebalancing finished
.
As soon as service is using the static dataset, multiple calls of the endpoint should produce the same result.
Over the time output will change because of the time, that is used for the age
calculation.
The maximum amount of trades per batch can be configured via fps.batch-size
property in application.yml.
Default value is 2
. If removed, batch size will be 1
(no batching).
- Customers defined in the csv file customers.csv
- Strategies defined in the csv file strategy.csv
- Portfolios defined in the code InMemoryFpsGateway.kt