Trading2024

Capital Market

Capital Market brings live stock data and portfolio analytics into apps people already have on their phones — IME Pay, Khalti, and the Global IME Bank app. It integrates live market data for analytics and reporting, and calculates real-time profit and loss, receivable amounts, and transaction summaries.

Role
Associate Software Developer — Capital Market team, Swift Technology
Timeline
2.5 years
Team
Capital Market team
System Design

Architecture

ChannelsEdgeServicesDatasubscribesIME PayKhaltiGlobal IME BankCapital Market APIone API, three appsLive Market Datatick ingestP&L Enginecomputed in real timePortfolio Analyticsread-optimizedNEPSE Feedlive ticksPostgreSQLholdings + txns

Prices flow in once and fan out to three apps. Every P&L figure is derived against the live tick at read time — nothing is a stored snapshot that can go stale.

01

Live Market Data

The module integrates live stock data — last traded price, change percentage, and the rest of the tick — and feeds it into analytics and reporting. Market data is only worth showing if it's current: a portfolio valued against a stale price is a wrong number presented confidently, which is worse than showing no number at all.

02

Portfolio At Scale

Portfolio data is large and read-heavy — every holding and every transaction, across every user, re-valued against a price that never stops moving. The work here was in the database: optimizing queries so large-scale portfolio data could be processed efficiently, rather than fanning out into a query per holding and paying for it on every load.

03

Numbers People Actually Check

On top of the data sit the figures users open the app for: profit and loss, receivable amounts, and transaction summaries, computed in real time. These are derived rather than stored, which keeps them correct as prices move — and puts the whole burden on making the computation fast enough to feel instant.

In Practice

The API, Live

The numbers people open the app for — P&L, valuation, receivables — are derived at request time against the live NEPSE tick. Nothing in this response is a stored snapshot that can go stale.

capital-market — portfolio summary. Request: curl -s https://api.capital.internal/v1/portfolio/summary \ -H "Authorization: Bearer <channel-token>". Response: { "holdings": 34, "invested": "12,50,000.00", "market_value": "14,18,200.00", "pnl": "+1,68,200.00 (+13.45%)", "receivable": "25,400.00", "priced_at": "live tick, 2s ago" } 200 OK · computed on read, correct as the price moves

Built With

Node.jsMicroservicesPostgreSQLREST API

Next Project

Brish Terminal

View →