This was a tough one, and with hindsight too big for my very first proper coding project. It was also a lot of fun though during the various lockdows š
It started when I randomly stumbled over Part Time Larryās Youtube channel. He produces videos on how to interact with various finance APIs, one of which is the Alpaca Markets API. At the time he only had a couple of thousands subscribers (the tally now is close to 90k), and Alpaca was hardly known back then as well. It now provides the underlying trading platform for various fintechs.
In true Boglehead style I had been investing in an All-World ETF for quite some time by then, but was icked by the fact that to replicate the world economy, it also had to invest in oil, coal and gas companies. So I wanted to find a solution to create my own ETF using fractional shares.
Of course there are ESG or sustainable ETFs but they come with various issues. Their selection criteria sometimes mean that companies like Amazon or Apple are left out. Those ETFs also tend to be smaller and more expensive.
For simplicity I initially limited it to the S&P 500 (which actually contains 505 companies). I found names, market share, sectors and industries of all companies online. Armed with the data I planned the app to work like this:
I decided not to implement a portfolio view. You can log into Alpaca to see a detailed performance breakdown performance, so I didnāt feel it was necessary for the beginning.
For this project I had to learn Python for the calculations within the app, the basics of REST API to let the app talk to Alpaca, and HTML/CSS for the UI. And it took forever.I worked on it after my regular job, and occasionally on weekends. Oftentimes I had to wait for a response to my very basic posts on Stack Overflow to continue. But slowly over the course of a couple of weeks it came together.
And this is what it looks like:
However, in the S&P 500, the largest weight at the time of building it was Apple with more than 6%, whereas the smallest was around 0,01%. Thatās a massive spread and means that for a lot of āgreenā selections the smallest weight will be around those 0,01%. So the minimum investment at market weighting then jumps from $100 to $1 / 0,01% = $10,000.
My monthly contribution to my current ETF isnāt quite there yet ;-) and that also applies to most ETF investors.
ETF saving plans are often executed for free or incur a flat fee of $1 to $2 per execution. A tool that by definition wants users to build custom ETFs, not trade daily, will see very little trading revenue.
Alpaca provides great backend services but you still have to register with your national financial authority (in my case the German BaFin). The whole setup is way too complicated for an indie hacker-type of project.