Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorLop committed Feb 3, 2024
1 parent a61dbaf commit 6babfa5
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions README.md
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.

0 comments on commit 6babfa5

Please sign in to comment.