PortfolioTracking
Native Android Portfolio Manager with Real-Time Market Data & Analytics
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.
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
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.
Portfolio Calculation Engine
Computes XIRR, day gain/loss, unrealized P&L, sector allocations, and concentration risk metrics from normalized holding and transaction data.
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
Broker APIs use inconsistent authentication flows and rate limiting policies, complicating unified data fetching.
Implemented an adapter pattern with per-broker strategy classes and a request multiplexer that respects individual rate limits using a token bucket algorithm.
XIRR calculation for portfolios with thousands of transactions was causing UI freezes on lower-end devices.
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
Deepened expertise in Kotlin Coroutines, Flow, and structured concurrency patterns for building responsive data-intensive Android applications.
Gained comprehensive understanding of financial calculations (XIRR, TWRR) and Indian stock market data provider integrations.