Automation

4 min read

How I Built a Shareholder Dashboard That Replaced 6 Years of Manual Work and Taught Me More Than I Expected

The Finance team was doing it by hand.

Every week, someone would sit down with Excel sheets, cross-reference transactions, and try to make sense of 400,000 shareholder records listed on the NSE. Reports were manual. Patterns were approximate. And the CEO and CFO were making decisions based on data that was already hours — sometimes days — old.

When this project landed on my plate, I didn't fully appreciate what I was stepping into. I had never worked with financial or stock data before. I said yes anyway.

The Problem Was Bigger Than It Looked

At first glance, it seemed straightforward: build a dashboard, show some numbers. But the moment I started digging into the requirements, I realised the complexity ran deep.

The data wasn't clean. It wasn't current. In fact, it didn't even exist in the form we needed.

To build anything meaningful, I first had to reconstruct the past — generating backdated transactions for every week going back 6 years. Not just raw numbers either. Each week's holdings had to reflect the actual buying and selling activity of 400k shareholders, calculated using FIFO (First In, First Out) — the standard accounting method for determining which shares were sold and at what cost.

And then came the question I hadn't anticipated: How do you calculate the Average Acquisition Price for each shareholder?

This was my first real encounter with financial logic. I kept asking myself — if someone bought shares at ₹120, then again at ₹140, then sold some — what is their actual average cost now? How does the holding pattern shift week over week? How does this week's price compare to last week's to surface the real change in portfolio value?

These weren't just SQL queries. These were accounting concepts I had to learn from scratch, understand deeply, and then translate into reliable, automated processes.

The Journey (Including the Wrong Turns)

My first instinct was to process everything in a single large batch job. Pull all the data, calculate everything, push it out. It seemed logical — until I ran it.

The queries were slow. The logic for FIFO sequencing was breaking on edge cases — shareholders who had partial sells across multiple purchase lots, or weeks where no activity occurred but the price movement still affected holdings value. I had to rethink the approach entirely.

What eventually clicked was treating each week as an independent snapshot — building the current week's state by comparing it precisely to the previous week's. Once I had that mental model right, the logic became much cleaner to implement. The FIFO sequencing fell into place. The Average Acquisition Price calculation became deterministic.

The aha moment was realising this was less a data problem and more a sequencing problem. Get the order right, and everything else follows.

What We Actually Built

The dashboard had three core capabilities:

  • Shares Summary — a live overview of total shareholding, movement, and valuation across all 400k records

  • Top Buyers & Sellers — ranked views showing who was accumulating or offloading shares in a given week

  • Shareholding Pattern — breakdowns by category (retail, institutional, promoters), week-over-week comparisons, and price-impact analysis

The automation handled 85% of the entire process — what previously required manual effort from the Finance team every single week now ran on its own. Reports that took hours to compile were generated in minutes.

The dashboard went live and landed directly in front of the CEO, CFO, and the Finance team. Seeing C-suite executives make decisions using something I had built — from scratch, with technology I'd had to learn on the fly — was a feeling I hadn't quite experienced before.

What I'd Do Differently Today

Looking back with 12+ years of experience, a few things stand out.

I'd instrument the automation from day one — logging every run, every edge case, every anomaly. Financial data needs an audit trail, not just results.

I'd also invest earlier in understanding the business logic before touching code. The FIFO calculation and Average Acquisition Price concepts took me longer to get right than the actual implementation — because I was learning accounting and engineering simultaneously. In hindsight, a few hours with the Finance team at the start would have saved days of iteration.

The Takeaway

Don't wait until you feel "ready" for a domain before working in it.

Financial data, stock logic, FIFO accounting — none of it was in my skill set when this project started. But the underlying engineering instincts were. And those transferred completely.

The domain knowledge came from doing the work, asking the right questions, and being willing to sit with confusion long enough to understand it properly.

Whatever unfamiliar domain your next project lands you in — lean in. The discomfort is where the real learning lives.