Skip to content
View as agent
hedged.in today. The page still opens with the problem the product was built for, that almost everything sold to a retail investor is long only

Problem

Almost everything sold to a retail investor in India is long only, so a first-timer learns about risk the hard way, in a month when the market falls. The product’s answer was hedged ideas with the instruction spelled out, down to the capital required and the worst case. Speed was the engineering problem, because an idea is only worth acting on while its price holds. The same instruction has to reach the web app, an iPhone and an Android phone within seconds and look identical on all three.

Approach

One Node API owns the ideas, the positions and who may see what. A socket gateway pushes new ideas, price moves and alerts to whoever is connected, so nothing depends on a client remembering to ask. The clients are kept thin. They render the payload, and the numbers on the card come from the server instead of being calculated twice in two languages. The app only gives advice, and nobody’s money moves inside it.

A published idea in the app today: the structure, the capital it needs, the most it can make and the most it can lose, with placing the order left to your own broker

Architecture

Clients
Next.js on the web, one React Native codebase for iOS and Android
API
Node.js REST, one contract for all three clients
Realtime
Socket.io gateway for published ideas, price moves and alerts
Data
MySQL through Sequelize
Access
Three tiers, free through to one with a minimum capital requirement, deciding which ideas an account can see
Infra
Docker images on AWS, same image in every environment

Decisions

  • Keeping access rules in one backendPublishing an idea is one write and one push, and the rules for who sees it live in the backend. If each client decided for itself, a paid idea could show up on a free account, which is a problem for an advice business.
  • Pushing updates over socketsDuring market hours a polling client is either late or expensive. Prices, alerts and new ideas go out over sockets as they happen, and the phones hold the connection while the app is open instead of waking every few seconds to ask what changed.
  • The app stops at adviceThe card tells you the trade, the capital it needs, the most you can make and the most you can lose, and you place the order with your broker. Stopping there kept the regulated product clear about what it does and kept order execution out of scope.

Outcome

We launched on web, iOS and Android inside five months from one API and one socket gateway, with four engineers and no separate mobile team, each of us working across the API and the clients. The client’s own team has carried it since and grown it past 100,000 installs on the Play Store, rated 4.5 there and 4.8 on the App Store.

View as agent