Users can select stocks and optimise their portfolios through the application of the Modern Portfolio Theory (MPT). The application calculates the volatility and returns of the stocks and portfolios and prices European options based on the Black-Scholes model. The results are plotted in charts in the web client.
The application is available at www.romoclub.com and it uses a React web client, microservices developed with Node (Express) and Python (FastAPI), nginx as a reverse proxy and Redis as a caching layer. The services are deployed in Docker containers in Elastic Beanstalk through Travis CI/CD pipeline.
- Calculation of the volatility and returns of individual stocks and portfolios.
- Optimisation of the portfolio composition by modelling different distributions of the stocks weight and calculating the Sharpe ratio.
- Pricing of European Call options.
You can clone this project and run docker-compose up. See example.env for the environment variables that you need to add manually. The containers can be built with "bash bdev.sh".
You can run the tests of each service through "npm run test" or "python -m pytest".
- Pytest & Jest: Used for unit testing with mocks for external dependencies in the microservices
- Supertest and TestClient: Used for API testing that includes external dependencies in the microservices.
- react-testing-library: Used for testing of components and redux reducers in the React webt client
- Calculator: It runs the financial calculations of the stocks and portfolios.
- Pricer: It retrieves the historical data of the stocks.
- Gateway: It is the gateway exposed to the web client that orchestrates and aggregates the responses from the microservices.
- Client: This is the web client for the end users and it is served as static content from an nginx server.
- Redis: Caching layer of historical stock data. The data is purged at the end of the day.
- Nginx: It is a reverse proxy that brokers the requests between the Client and Gateway.
This application uses Travis CI to implement Continuous Delivery and Integration and the services are deployed in Docker containers in Elastic Beanstalk.
- Nodejs-Express - Javascript microservice framework.
- FastAPI - Python microservice framework.
- React - User Interface library.
- Nginx - Reverse Proxy and web server.
- Redis - In memory store database.
- Docker - Used to containerize the services.
- Transition to a websocket connection between the Client and Gateway and utilise a message broker to manage asynchronous requests between the gateway and other services.
- Ignacio Vidal
This platform has been developed for personal educational purposes to apply for a Masters degree. It is not to be considered as investment advice.