-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
# FundSimulatorRS | ||
FundSimulatorRS is a versatile Rust-based program for simulating the behaviour of index funds through easy-to-configure settings. | ||
|
||
|
||
## Usage | ||
The actual implementation run on the CLI, being customizable by the following parameters: | ||
- `--amount` or `-a`: Initial amount for the investing | ||
- `--interest` or `-i`: Annual percentage of interest | ||
- `--years` or `-y`: Investment years | ||
- `--contributions` or `-c`: Extra contribution per year | ||
The application can run in two modes: server and CLI. Both modes use a JSON file as input. It must include the following information: | ||
- `deposit`: Integer representing the initial deposit. | ||
- `years`: Integer representing the number of years for the simulation. | ||
- `return_rates`: Float or list of floats. If a single float, then the same return rate is applied for all the years. Otherwise, the number of elements in the list must be equal to the number of years. | ||
- `annual_contributions`: Float or list of floats. If a single float, then the same annual contribution is applied for all the years. Otherwise, the number of elements in the list must be equal to the number of years. | ||
|
||
### CLI mode | ||
``` | ||
cargo run -- --mode cli --config-file example.json | ||
``` | ||
|
||
### Server mode | ||
Run the following command or `docker compose run` to start the server. | ||
``` | ||
cargo run -- --mode server | ||
``` | ||
It will be listening on port 3000 by default. | ||
The endpoint is `/simulate` and you need to pass the config json in the payload. |