← All work
Case study · 2025

DhanSetu

A paper-trading tournament platform: traders compete with virtual funds on real market prices, with live leaderboards and an Android app.

Next.jsMongoDBPythonAndroidLive site ↗
thedhansetu.com
DhanSetu — screenshot of the live site

Overview

DhanSetu runs trading tournaments. Players join a tournament, trade with virtual money against real market prices, and climb a live leaderboard; the top ranks win prizes. It has a web app, an Android app, a dashboard for players, and an academy section for people learning to trade.

The code is in a private repository, so this write-up covers the product and its overall shape.

The problem

Learning to trade usually means risking real money before you know what you're doing. Paper trading removes the risk but also removes the motivation. DhanSetu adds what paper trading lacks: a field of other players, a clock, and a ranking that updates while you trade.

What it does

  • Tournament arena: time-boxed rounds, each with a prize pool, an entry fee, a participant count and a countdown to the end of the round.
  • Trading on virtual funds: players place trades against live prices; every player starts a round with the same virtual balance.
  • Live leaderboard: players are ranked by profit percentage, and the ranking updates while a round is running.
  • Player dashboard and academy: a player's positions and history, and lessons for beginners.
  • Android app: shipped as an APK alongside the web app.

Screens

Landing page with the prize pool and app download Academy: beginner, intermediate and advanced learning tracks

Architecture

Clients talk to one API. Market prices stream in from outside, and every trade is valued against them.

flowchart LR
  subgraph clients["Clients"]
    web["Web app - Next.js"]
    apk["Android app"]
  end
  subgraph core["Backend"]
    api["API"]
    engine["Trade and P and L engine - Python"]
    board["Leaderboard"]
  end
  subgraph data["Data"]
    db[("MongoDB: users, tournaments, orders, positions")]
  end
  feed["Market price feed"]
  web --> api
  apk --> api
  api --> engine
  feed --> engine
  engine --> db
  engine --> board
  board -->|"live ranks"| web
  board -->|"live ranks"| apk

System design

What happens when a player places a trade during a live round.

sequenceDiagram
  participant P as Player
  participant A as API
  participant E as Trade engine
  participant DB as MongoDB
  participant L as Leaderboard
  P->>A: Place an order
  A->>A: Check the round is live and the player has joined
  A->>E: Validate against virtual balance
  E->>E: Fill at the current market price
  E->>DB: Save the order and update the position
  E->>L: Recompute profit percentage for the player
  L-->>P: New rank

Decisions & trade-offs

  • Virtual funds, real prices. Everyone starts from the same balance and trades against the same market, so the ranking measures skill, not starting money.
  • Profit percentage, not absolute profit. Ranking on percentage return keeps the leaderboard fair while every player trades the same balance.

What I'd do next

  • Add replays of past rounds, so players can study how the winners traded.
  • Publish the anti-cheat rules, so players can see exactly what counts as a fair trade.