AKD Mobile Trading — live stock trading on Flutter for Pakistan retail investors



Constraint
The box they were trapped in
Retail trading on the Pakistan Stock Exchange happens on phones, not desktops, and the customer base is mostly on mid-range Android over patchy 4G. The app had to push live tick data, render an order book, and execute buy/sell orders quickly enough that the price the user tapped was still the price the order hit — without burning the device's battery or rebuilding the UI for two operating systems separately. AKD also needed feature parity between iOS and Android from day one.
Approach
How we attacked it
A Flutter app with a single codebase across iOS and Android, with a WebSocket connection back to the broker feed for live ticks, the order book, and trade-execution acks. Live prices and chart widgets render through StreamBuilder, so a quote update redraws only the affected widget instead of the surrounding UI. Firebase Realtime Database handles the cross-device session sync, AWS Lambda fronts the order-handling and auth APIs, and a Node.js backend wires it all to AKD's existing brokerage systems. Modular architecture so a new instrument type or chart overlay drops in without touching the trade flow.
Decisions
What we picked, and what we rejected
Flutter over native iOS + native Android
AKD needed feature parity across both platforms from day one and an internal team that wouldn't have to do every change twice. Flutter ships one codebase with platform-grade performance for this kind of UI, and the rendering pipeline handles the tick-driven repaints without the sluggishness a hybrid wrapper would have introduced.
WebSockets + StreamBuilder for live data
Polling for prices is the wrong shape for a trading screen — by the time the next request returns, the price has moved. A WebSocket holds the connection open and pushes ticks as they happen, and Flutter's StreamBuilder rebuilds only the price widgets that actually changed instead of redrawing the surrounding UI on every tick.
Firebase Realtime Database for cross-device session sync
A user on their phone in the morning should see the same watchlist and pending orders on their tablet at lunch. Firebase Realtime gave us that sync without writing a custom socket layer for state, and it kept the auth + sync stack in one place so we could spend the engineering on the trading-specific code instead.
AWS Lambda + Node.js for order and auth APIs
Trading load is bursty — open and close are loud, the middle of the day is quiet. Lambda scales down to zero between bursts and up under load without pre-provisioning, and Node.js was the right runtime for the I/O-heavy work of fronting WebSockets and the broker's order APIs.
Trade-off
What we didn't build
We did not build separate native iOS and Android apps. One Flutter codebase ships feature parity in one pass and doesn't double the maintenance bill — a real concern for an internal team that has to keep up with PSX rule changes year after year. We also did not bolt on a desktop terminal. Retail traders in this market use their phone; serious institutional flow runs through other channels, and a desktop port would have stretched the team without changing who actually traded on it.
Outcome
What changed after we shipped
Live in production with AKD Securities' retail customer base. Live PSX feeds, real-time order book, theme-adaptive UI, and trade execution all in one cross-platform app, and the modular architecture has held up to subsequent feature additions without rewrites to the trade flow.
Talk to us
Have a similar project in mind?
Tell us what you're working on. We'll let you know whether it's a fit.