Generates top 10 mutual funds in each category and prints in excel
Setup :
- Java 21 - install from official website based on OS
- Postman/insomnia
- IDE - STS/Eclipse/IntelliJ
Running the springboot application
- Clone the repository in your local using the command "git clone https://github.com/vaishsridh/MutualFundGenerator.git"
- Open the repository in any IDE of your choice
- Run the springboot application
- Hit send and download "http://localhost:8080/download" on postman
How does it work ? For each category (flexicap, smallcap and midcap), funds have been selected manually based on the age of the mutual fund ( > 5 years). Funds are available on https://www.amfiindia.com/spages/NAVAll.txt
Since we want historical data, we will be choosing regular growth mutual funds and not direct growth. Direct funds came into existence much later. Direct and Regular funds of an AMC inherently share the same composition.
Each fund has a corresponding numeric code available in above text file. APIs are formed by this numeric code and gives us historical NAV (Ex: https://api.mfapi.in/mf/144548) API urls are hardcoded in the application.
Generate combinations of 3 in each category and calculate average rolling returns, standard deviation and sharpe ratio based on latest inception date among 3 funds in a combination. Sharpe ratio is calculated as (average rolling returns - 7)/standard deviation.Choose the mutual fund in each combination with highest sharpe ratio among other other two.
Implement above process recursively and print top 10.
TODO : Short term :
- Implement caching preferably by storing data in redis DB and refresh it every 24h at 11 PM IST
- Data quality checks for missing NAVs. Present calculation includes 0 NAV.
- Write junits
- Enhance security - API urls are exposed as constants
- Expand to ELSS category
Medium term :
- Work on frontend to leverage the option of subscribing and adding to mailing list
- Explore multithreading
- Automate to mail excel to mail ids
- Implement Holiday Calendar to not calculate on holidays
- Host it on any server supporting springboot applications
- Include expense ratio into account - Optional
Long term :
- Enhance data quality by giving leeway to standard deviation and returns
- Data collection is manual. It can be automated by considering funds with inception date > 5 years.
- Expand to international funds
- Exclude funds involved in front running or scam by crawling across the web - Optional