QuantEngine.

Stochastic Monte Carlo & Reverse DCF Pipeline for SUN.NS

📊 What is this?

This engine runs a Monte Carlo Simulation. Instead of guessing a single future, it runs thousands of probabilistic scenarios testing how variations in revenue and margins will impact Sun Pharma's true underlying value.

🔗 Where is the data from?

The core structural inputs (Total Debt, Cash Equivalents, the 10.5% WACC discount rate, and Base Revenue) were automatically extracted from the live LSEG (Refinitiv) API utilizing a 5-year historical baseline.

🎯 How to read the output?

The model outputs the Intrinsic Target Price. If our simulated Base Case price is lower than Sun Pharma's current market trading price (~₹1,868), the stock is mathematically considered Overvalued (SELL).

Bear Case (10th) ₹ --

90% chance value is higher

Base Case (50th) ₹ --

Most probable target price

Bull Case (90th) ₹ --

Only 10% chance to exceed

Calculating 10,000 Scenarios...

About The Architecture

This application is the culmination of a 5-phase automated quantitative finance pipeline.

1

Automated LSEG Data Pipeline

Built a robust Python extraction layer utilizing the Refinitiv Workspace API. It dynamically pulls 5-years of trailing historical financials, deduplicates the time-series data, and establishes the foundational metrics (Revenue, CapEx, D&A, Debt, Cash).

2

Base Case Forecasting & WACC

Constructed a deterministic 5-year Free Cash Flow to Firm (FCFF) forecast. It mathematically computes the Weighted Average Cost of Capital (WACC) using dynamic risk-free rates and market risk premiums to discount future cash flows accurately.

3

The Valuation Bridge (DCF)

Implemented an institutional-grade Gordon Growth Model (GGM) to calculate the Terminal Value. It then bridges the Enterprise Value down to Equity Value by accounting for the exact net debt position to find the deterministic intrinsic share price.

4

The Stochastic Monte Carlo Engine

Upgraded the static DCF into a dynamic probabilistic model using NumPy and SciPy. By injecting standard deviations into core drivers and penalizing cash flows with Net Working Capital (NWC) drag, the model runs 10,000 parallel universes to find the true statistical center of mass.

5

Full-Stack Web Integration

Wrapped the entire Python algorithmic backend into a blazing fast FastAPI server, and surfaced it to the user via this responsive, glassmorphism-styled Vite frontend to allow for real-time stress-testing and portfolio presentation.