Back

Case study

MYNRobo

Algorithmic F&O Trading Platform

mynrobo.com

Visit live site

Product preview

Screenshots

Overview

Architected MYN Robo — a multi-broker algorithmic F&O platform for Indian markets. Split worker architecture handles market feed, strategy signals, and broker execution independently. Redis powers live tick caching and async command routing. MongoDB stores users, strategy maps, trades, and orders. A unified broker adapter layer connects Master Trust, Fyers, Alice Blue, and Flattrade behind a single order gateway with live WebSocket P&L for traders and a full admin console.

Problem & goal

The Challenge

Retail and prop-style traders need automated index-option and commodity-future strategies across multiple brokers — with centralized risk controls, live P&L, and operations tooling — without building separate integrations per broker or running fragile single-process bots.

MYN Robo delivers production-grade algo strategies, maps subscribers to live settings, executes orders on Master Trust, Fyers, Alice Blue, and Flattrade, and gives admins full control over market data, holidays, subscriptions, and platform safeguards.

Target users

Who It's For

  • Traders & clients — connect broker accounts, view live trades and history, manage paper vs live mode

  • Admins & super admins — strategy settings, user mapping, market feed, holidays, client lifecycle

  • Operations — market-open runbooks, worker health checks, and incident response

Core capabilities

Platform Modules

Auth & access control

Secure login with email verification, role-based permissions, and admin tooling for client lifecycle management.

Broker accounts

Multi-broker OAuth connections, daily session lifecycle, and paper vs live trading modes per account.

Market data

Live feed integration, instrument sync, and centralized market configuration for NSE, BSE, and MCX.

Strategy engine

Pluggable strategies for index options (MYN_OPT, MYN_OPT_FULL_DAY) and MCX futures (MYN_FUT).

Order execution

Single order gateway with duplicate-order prevention and fill reconciliation across brokers.

Subscriber mapping

Map master strategy settings to many users with independent lot scaling and premium overrides.

Real-time updates

Live WebSocket streams for LTP, open-position P&L, and admin strategy monitoring.

Subscriptions & admin

Plan management, active subscription gating, audit logging, and operational dashboards.

High-level design

System Architecture

The platform separates the Next.js frontend (trader dashboard, admin console, OAuth flows) from a stateless FastAPI backend that handles REST APIs, WebSocket hubs, RBAC, and health checks. MongoDB stores users, strategies, orders, maps, and audit data. Redis powers LTP caching, pub/sub fan-out, idempotency, and the trade command bus.

Dedicated worker processes handle market feed ingestion, strategy signal generation, and broker order execution — so API restarts never interrupt live trading. A broker adapter layer unifies Master Trust, Fyers, Alice Blue, and Flattrade behind a single order gateway. Role-based admin controls and encrypted broker credential storage protect sensitive operations.

Production stack

Technology Stack

Frontend

  • Next.js
  • React.js
  • TypeScript
  • Tailwind CSS
  • ShadCN UI

Backend

  • FastAPI
  • Python
  • Pydantic
  • WebSockets

Data & messaging

  • MongoDB
  • Redis

Infrastructure

  • Docker
  • Nginx
  • Prometheus
  • GitHub Actions

Strategies & risk

Trading Engine

Risk & lifecycle

Per-trade and per-day stop-loss and target limits, entry fill reconciliation, unfilled entry timeouts, and automatic session square-off.

Manual controls

Admin start, stop, and halt controls plus manual entry and exit APIs for operational override.

Unified adapter layer

Multi-Broker Integration

Supported brokers

Master Trust, Fyers, Alice Blue, and Flattrade connected through a shared broker client interface and single order gateway.

Cross-broker logic

OAuth onboarding, order placement and cancellation, fill status polling, position queries, and symbol resolution from a unified instrument catalog.

Paper trading

Explicit paper-mode fallback with reason codes for safe testing before live execution.

Live data pipeline

Real-Time Experience

Market ticks flow from the feed worker into an in-memory cache and pub/sub layer, then through the API WebSocket hub to connected clients. Traders receive live trade snapshots, tick-driven P&L updates, and closed-trade notifications. Stale tick detection and throttled fan-out keep the UI responsive during high-volume sessions. Admin streams provide live strategy runtime and trade monitoring.

Scaled strategy execution

Subscriber Mapping

Each master strategy setting fans out to mapped subscribers — per user, per broker account, with independent lot scaling and premium overrides. Signal waves create one trade and one broker order per mapped client, with per-user day limits and safeguards against duplicate entries on shared settings.

Challenges solved

Engineering Highlights

01

Broker sessions expire daily

Automated token lifecycle management with forced paper mode until the trader reconnects via OAuth.

02

API restarts interrupting trading

Split worker architecture — feed, strategy, and execution processes run independently of the API.

03

High tick volume during market hours

In-memory LTP cache with pub/sub decoupling and throttled WebSocket fan-out to clients.

04

Duplicate orders on retries

Duplicate-order prevention and quantity-aware exit keys at the order gateway.

05

Broker rejections affecting all users

Per-account safeguards that halt only the affected account, not the entire strategy.

06

Weekend and holiday worker waste

Holiday calendar integration with trading-day-aware worker scheduling.

07

MCX contract expiry

Automated rollover workflow — force-exit expiring futures and sync next-month instruments.

Built for production load

Performance & Scale

  • In-memory LTP cache avoids REST polling on every tick

  • Pub/sub decouples feed workers from the API WebSocket hub

  • Throttled partial updates reduce client render load

  • Async command bus decouples signal workers from broker execution

  • Stateless API supports horizontal scaling behind a reverse proxy

  • Split strategy workers allow independent load per product line

  • Paginated admin lists and metrics for operational visibility

Operations

Deployment

The platform runs in Docker containers — database, cache, API, workers, frontend, and reverse proxy — with automated TLS and Asia/Kolkata timezone across all services. Scheduled trading-day automation starts workers on market days and skips weekends and exchange holidays. Structured logging, health endpoints, and optional error monitoring support production operations.

Roadmap

What's Next

  • Self-serve subscription payments

  • Push and SMS alerts on SL, target, and session square-off

  • Historical backtesting on candle data

  • Strategy marketplace for third-party algos

  • Portfolio analytics across accounts and strategies

  • Additional broker integrations via the same adapter interface