BACK TO ARCHIVECase Study 10
2026
CASE STUDY

PortfolioTracking

Native Android Portfolio Manager with Real-Time Market Data & Analytics

KotlinAndroidFinanceReal-time Data

01 / Project Overview

A feature-rich native Android application for personal investment portfolio management. Supports manual holding entry and broker API integration to maintain an aggregated view of equities, ETFs, and mutual funds. Live market data feeds update holdings valuations every 15 seconds during market hours, with performance calculated against average cost basis. The app includes allocation pie charts, sector concentration heat maps, and historical P&L graphs.

Quick Facts
Released2026
RoleLead Engineer
Core FocusScale & Speed

02 / The Challenge & Problem

Real-World Problem Statement

Most retail investors in India manage portfolios across 2-4 different brokers, with no unified view of total invested value, current returns, or sector exposure. Broker apps are siloed, show only their own holdings, and lack the analytical depth (e.g., XIRR calculation, sector heat maps) that informed investment decisions require.

03 / The Engineering Solution

Implementation & Architectural Approach

Built a unified portfolio aggregation layer in Kotlin that consumes broker APIs (HDFC Securities, Zerodha, Groww) and a market data provider to present a single consolidated view. Implemented XIRR calculation for accurate annualized return measurement and real-time push notifications for significant price movements in held securities.

04 / Technical Architecture Flow

01Data Aggregation Layer

Multi-Broker API Connector

Coroutine-based async connectors for each supported broker's REST API, normalizing diverse response schemas into a unified Kotlin data model.

02Business Logic & Analytics

Portfolio Calculation Engine

Computes XIRR, day gain/loss, unrealized P&L, sector allocations, and concentration risk metrics from normalized holding and transaction data.

03UI Presentation Layer

Jetpack Compose Dashboard

Material Design 3 interface with interactive MPAndroidChart visualizations, real-time LiveData updates, and smooth animated transitions.

05 / Key Project Features

Multi-Broker Aggregation

Consolidates holdings from HDFC Securities, Zerodha, and Groww into a single unified portfolio view with normalized performance metrics.

XIRR & Real-time P&L

Calculates accurate annualized returns using XIRR methodology alongside live unrealized gain/loss updated every 15 seconds during market hours.

Sector Heat Map

Visualizes portfolio sector concentration and compares it against benchmark index weights to identify over/underexposure.

06 / Engineering Challenges & Mitigations

Blocker Difficulty

Broker APIs use inconsistent authentication flows and rate limiting policies, complicating unified data fetching.

Resolution Strategy

Implemented an adapter pattern with per-broker strategy classes and a request multiplexer that respects individual rate limits using a token bucket algorithm.

Blocker Difficulty

XIRR calculation for portfolios with thousands of transactions was causing UI freezes on lower-end devices.

Resolution Strategy

Moved XIRR computation to background Coroutine dispatchers with Kotlin Flow-based incremental updates to keep the UI responsive at all times.

07 / Technical & Personal Learnings

01

Deepened expertise in Kotlin Coroutines, Flow, and structured concurrency patterns for building responsive data-intensive Android applications.

02

Gained comprehensive understanding of financial calculations (XIRR, TWRR) and Indian stock market data provider integrations.

08 / Categorized Tech Stack

Android Development

Kotlin
Jetpack Compose
Android Architecture Components
Material Design 3

Async & Data

Kotlin Coroutines
Kotlin Flow
Retrofit2
Room Database

Visualization & Analytics

MPAndroidChart
XIRR Calculator
LiveData
Hilt DI