Skip to content

mayursh1/QuantX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QuantX - Structured Products Pricing Engine

IIM-A Project for Structured Products Pricing

Overview

QuantX is a comprehensive pricing engine for structured financial products, featuring:

  • Advanced Monte Carlo simulation pricing
  • Black-Scholes model implementation
  • Interactive React-based UI
  • Real-time pricing calculations

Supported Products

1. Autocallable Notes

Automatically callable notes that redeem early if the underlying asset price exceeds a barrier on observation dates. Investors receive principal plus accrued coupon upon early redemption.

2. Reverse Convertibles

High-coupon products that expose investors to downside risk. If the barrier is breached, investors receive physical delivery of the underlying asset instead of principal.

3. Barrier Options

Path-dependent options that are activated (knock-in) or deactivated (knock-out) when the underlying price crosses a barrier level.

Architecture

Backend (Python/FastAPI)

  • Framework: FastAPI for high-performance API endpoints
  • Pricing Engine: Monte Carlo simulation with Black-Scholes models
  • Libraries: NumPy for numerical computations, SciPy for statistical functions

Frontend (React/TypeScript)

  • Framework: React with TypeScript
  • Charts: Recharts for payoff diagrams
  • API Client: Axios for backend communication

Installation and Setup

Backend Setup

cd backend

# Create virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run the server
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload

Or use the provided script:

cd backend
chmod +x run.sh
./run.sh

The API will be available at http://localhost:8000

  • API Documentation: http://localhost:8000/docs
  • OpenAPI Spec: http://localhost:8000/openapi.json

Frontend Setup

cd frontend

# Install dependencies
npm install

# Start the development server
npm start

The UI will be available at http://localhost:3000

API Endpoints

POST /api/pricing/autocallable

Price an autocallable note

Request Body:

{
  "spot_price": 100,
  "strike_price": 100,
  "barrier_level": 100,
  "downside_barrier": 70,
  "coupon_rate": 10,
  "observation_dates": [0.5, 1.0, 1.5, 2.0],
  "maturity": 2.0,
  "risk_free_rate": 5,
  "volatility": 25,
  "simulations": 10000
}

POST /api/pricing/reverse-convertible

Price a reverse convertible note

Request Body:

{
  "spot_price": 100,
  "strike_price": 100,
  "barrier_level": 70,
  "coupon_rate": 15,
  "maturity": 1.0,
  "risk_free_rate": 5,
  "volatility": 25,
  "simulations": 10000
}

POST /api/pricing/barrier-option

Price a barrier option

Request Body:

{
  "spot_price": 100,
  "strike_price": 100,
  "barrier_level": 110,
  "barrier_type": "up_and_out",
  "option_type": "call",
  "maturity": 1.0,
  "risk_free_rate": 5,
  "volatility": 25,
  "dividend_yield": 0,
  "simulations": 10000
}

Features

  • Monte Carlo Simulation: High-accuracy pricing using configurable number of simulations
  • Confidence Intervals: 95% confidence intervals for all pricing results
  • Payoff Diagrams: Visual representation of product payoffs
  • Interactive UI: User-friendly forms with real-time validation
  • Responsive Design: Works on desktop and mobile devices

Technology Stack

Backend:

  • Python 3.8+
  • FastAPI
  • NumPy
  • SciPy
  • Pydantic

Frontend:

  • React 18
  • TypeScript
  • Recharts
  • Axios

Development

Running Tests

# Backend tests (if available)
cd backend
pytest

# Frontend tests
cd frontend
npm test

Building for Production

Backend:

cd backend
pip install -r requirements.txt
uvicorn app.main:app --host 0.0.0.0 --port 8000

Frontend:

cd frontend
npm run build
# Serve the build folder with any static file server

License

IIM-A Academic Project

Contributors

IIM-A Students - Structured Products Pricing Team

About

IIM-A Project for Structured Project pricing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors