DEV Community

Andrea Gelmini
Andrea Gelmini

Posted on

I built a small tool to analyze ETFs and realized the best code is a checklist

As a developer, my first instinct is to solve problems by writing code.

Recently, I decided to clean up my ETF portfolio. I was drowning in data and, I have to admit, I didn't even remember buying some of them. My first thought was immediate: "I'll build a tool for this."

First roadblock: there are no free APIs to query for this data (if you know of any, please leave a comment!). So, I fell back on good old-fashioned scraping. Nothing fancy: just some vanilla JS, a bit of HTML, and I put together a script to fetch data from an analysis portal via ISIN, cache the results for 24 hours, and display the key metrics.

But the fun part—the real challenge—wasn't the code. It was defining the validation logic.

What makes an ETF a "good" choice? I realized I was essentially building a checklist.

For example, a crucial check is the fund's domicile. A simple if (domicile === 'Ireland' || domicile === 'Luxembourg') can have a massive impact on your net returns, thanks to tax treaties on US dividends (15% tax vs. 30%). Another key factor is the TER (Total Expense Ratio). My logic had to red-flag any ETF with a TER > 0.3%.

In the end, the tool was just a nice bonus. The real treasure was the 7-point checklist I created to power its logic. I've now expanded that logic into a full guide, explaining the "why" behind each critical point.

If you want to get past the "how" and truly understand the "why" of choosing the right ETF, you can read the full post here. The tool is included.

Top comments (0)