Traders and investors often rely on fragmented, inaccurate web tools to plan positions, compute compound wealth, calculate retirement cashflow, track stock dip averaging, and estimate statutory brokerage taxes. Standard calculators fail to model bi-directional dependencies (e.g. solving position size from max risk amount), omit hidden transaction costs (STT, GST, SEBI turnover fees, DP charges), and lack forward-looking strategies like Step-Up SIPs, stop-and-hold compounding, or loan prepayment arbitrage. Universal Trading Calculator unites all seven workflows into a single state-preserving, cross-platform interface.
Universal Trading & Wealth Calculator
A high-precision trading risk, wealth compounding, and financial engineering calculator built with React Native and Expo, featuring 7 dedicated workstations.

About Universal Trading & Wealth Calculator
Universal Trading & Wealth Calculator brings institutional-grade financial computation and risk management into a unified cross-platform Expo and React Native suite. Designed with sleek fintech aesthetics, responsive desktop/mobile containers, and real-time bi-directional derivations, the application offers 7 specialized workstations: Universal Trading Calculator with trade quality scoring and price ladders, Wealth Compounding & SIP Calculator with step-up and inflation adjustments, Stock Average Down Planner, Systematic Withdrawal Plan (SWP) for retirement longevity, Brokerage & Statutory Taxes with true zero-brokerage support, Goal-Based Reverse Engineering, and Loan Prepayment with EMI vs. SIP arbitrage analysis.
Product thinking
Challenge and approach
The computation core uses interconnected bi-directional constraint models: adjusting any variable (e.g. SL %, risk capital, or target price) dynamically recalculates dependent inputs while enforcing non-negative limits and boundary validations. Tax engines calculate statutory Indian levies based on segment-specific formulas (STT on sell premium for options, dual STT for delivery, DP charges, and 18% GST). Amortization algorithms iteratively evaluate monthly cashflows, prepayment offsets, and compounding SIP arbitrage paths.
Capabilities
Key capabilities & features
Universal Trading Workstation: 10-variable bi-directional derivation engine linking Entry, Stop Loss, SL %, Target, Target %, Risk:Reward, Quantity, Position Amount, Max Risk Amount, and Profit Amount
Trade Quality Scorecard & Price Ladder: Real-time trade grading (Poor, Acceptable, Good, Excellent), visual R:R distribution bars, and SVG-rendered price action ladder with distance percentages
Wealth Compounding & SIP Calculator: Regular Monthly SIP, SIP & Grow (stop SIP & hold to let corpus compound untouched), and One-Time Lumpsum investment modes
Annual Step-Up & Inflation Adjustments: Dynamic annual contribution growth (+5%, +10%, +15%, or custom %/yr) with inflation-adjusted real purchasing power calculations
Dynamic Asset Visualizations: SVG Donut chart displaying Principal Invested vs. Compounded Wealth with compact ₹ Lakh / Crore notation and phase-aware growth progression milestones
Stock Average Down Planner: Multi-batch purchase lot averaging (up to 8 lots) with live P&L and breakeven tracking, capital allocation bars, and What-If Target Average Down reverse solver
Retirement & SWP Engine: Systematic Withdrawal Plan cashflow simulation with annual step-up withdrawals, safe withdrawal rate (SWR) benchmarking, evergreen portfolio detection, and corpus depletion horizons
Brokerage & Statutory Tax Calculator: Multi-broker architecture (Shoonya ₹0, FlatTrade ₹0, Upstox, Zerodha, Groww, Angel One, Religare, and Custom) across Options, Delivery, Intraday, and Futures with itemized STT, GST, SEBI turnover, Stamp Duty, and DP charges
Zero-Brokerage Savings & Breakeven: Displays exact cash + GST savings (₹47.20/trade) for zero-brokerage platforms and calculates exact price move points required to break even
Goal-Based Wealth Planner: Reverse financial engineering solving required monthly SIP or lumpsum for life milestones (Car, Education, Home Downpayment, FIRE, Wedding) with existing savings offset
Loan, Prepayment & EMI vs. SIP: Smart EMI amortization, 13th-month extra EMI hack, annual EMI step-up, and Prepay Loan vs. Invest in Equity SIP arbitrage calculating net wealth advantage
Cross-Platform Fintech UX: Obsidian Dark (#090D16) and Clean Slate Light (#F8FAFC) themes, state-preserving 7-tab bar, responsive centered desktop container, and high-resolution PNG / Web Share export
Architecture
System structure & pipeline
App.js serves as the responsive application shell with top 7-tab state-preserving navigation and light/dark theme context.
Modular screen components (CalculatorScreen, SipCalculatorScreen, SwpCalculatorScreen, StockAverageScreen, BrokerageCalculatorScreen, GoalCalculatorScreen, LoanCalculatorScreen) isolate workstation interfaces.
Specialized financial math engines in src/utils/ (averageCalculations, brokerageCalculations, goalCalculations, loanCalculations, sipCalculations, swpCalculations) handle precision compounding, tax schedules, and iterative derivations.
Custom SVG visualization layer (SipDonutChart, PriceLadder, LotAllocationBar) provides responsive visual feedback on mobile and desktop web displays.
Automated GitHub Actions CI/CD workflows trigger continuous web deployment to EAS Hosting and automated standalone Android APK build releases.
Implementation
Technology and data pipeline
Technology stack
- React Native
- Expo
- React Native SVG
- EAS Build & Hosting
- GitHub Actions CI/CD
- JavaScript (ES6+)
Engineering details
Technical considerations
OperationsDeployment considerations
- Developed with Node.js 18+, React Native, and Expo SDK with web and native mobile runtime targets.
- Automated GitHub Actions pipeline runs npx expo export and deploys production static web bundles to EAS Hosting (https://riyaz-trading-calc.expo.app/).
- Automated APK release workflow builds standalone Android APKs via EAS and attaches installable binaries directly to GitHub Releases upon version tagging.
Use cases
What the project supports
- Calculate exact share quantity and position sizing based on defined maximum risk tolerance and stop-loss levels
- Plan long-term wealth creation with Step-Up SIPs and model early retirement through SIP & Grow stop-and-hold strategies
- Determine required additional shares and capital needed to average down a stock position to a target breakeven price
- Simulate retirement cashflows and test portfolio longevity against inflation using Systematic Withdrawal Plans (SWP)
- Compare net trading profitability and statutory taxes between zero-brokerage brokers (Shoonya, FlatTrade) and standard discount brokers
- Reverse engineer monthly investment requirements for major life goals such as home buying, higher education, or FIRE
- Decide whether to prepay an active home loan or invest excess monthly surplus into equity mutual funds for higher net wealth


