REST API service that provides tools to create custom portfolios of financial assets and analyze them using historical market data as well as some embedded financial models.
You can check out (hosted on render.com free tier so can take ~50 seconds to load)
- Creation of fully customizabe portfolio using all publicly traded shares and indexes on MOEX
- Retrieval of historical market data from MOEX
- Calculation of aggregated portfolio values
This repository contains both Dockerfile and docker-compose.yml so you use either of them.
For docker-compose:
git clone https://github.com/TsirelsonStepan/FinCalc.git
cd FinCalc
# Build Docker image
docker build -t fincalc-app:latest .
# Run container
docker-compose upIf you prefer using simple Dockerfile:
git clone https://github.com/TsirelsonStepan/FinCalc.git
cd FinCalc
# Build Docker image
docker build -t fincalc-app:latest .
# Run container
docker run -p 80:8080 fincalc-app:latestAll endpoints as well as some other information are documented in OpenAPI format in . For OpenAPI UI deploy locally and go to /swagger/index.html or visit
.
The API relies on several key objects:
- Controllers: Handle all the incoming requests (Works only with "application/json").
- MOEX API: The main source of market data. (The main direction of development for this project is introduction of new data sources).
- Data Structures: The collection of datatypes that represent market related data:
- Historic data - for all sequences of values in time, contains additional fields for intervals and real time Period.
- Asset and AssetInPortfolio - for all financial assets, contains id, market asset is traded on and for AssetInPortfolio - amount.
- Portfolio - main datatype that contains list of assets and all calculated indicators and datasets - historical averages, weighted average annual retruns, etc.
- Calculator - contains sevral models for calculating financial indicators:
- CAPM (Capital Assets Pricing Model): for estimating future returns.
- As well as basic math operations: Annualize returns and weighted average of annual returns.
For more detailed documentation of the architechture check the diagrams.
In future updates I plan mainly on increasing the number of financial data providers to add new markets, new types of assets, etc. Also in near future I plan to add import/export functionality to allow saving custom portfolios.
If you are interested in this project, have ideas for improvement or have a job offer for me - here is my email - tsirelsons@gmail.com)