About Final Year Project

COMSATS University Islamabad · Abbottabad Campus · FYP 2026

PSX GenAI Investment Advisor

A full-stack investment intelligence platform for the Pakistan Stock Exchange — powered by the proprietary PSXFusion™ AI Model, combining multi-LLM forecasting, LSTM baselines, dual Shariah screening, hybrid portfolio intelligence, and a React Native mobile client.

4
AI Models
110+
Stocks Analyzed (AI)
535+
PSX Universe (DPS)
358+
Matched Evaluations
2
Shariah Frameworks
Full Stack
Web + Mobile

FYP Team & Supervision

Lead Developer & Owner

Hamza Jadoon

Principal architect and implementer — backend, frontend, mobile app, PSX Fusion AI Model, ADE, Copilot, PFRE, and full deployment.

Group Member

Fizza

Official FYP group member, COMSATS University Islamabad · Session 2026.

Supervisor

Dr. Gulam Mujtaba

Academic supervisor — technical guidance and project review throughout the FYP.

1. Introduction

Pakistan's retail investors lack integrated tools that combine AI-driven stock predictions, transparent model benchmarking, Shariah compliance verification, and explainable portfolio recommendations. This Final Year Project delivers a production-quality platform that addresses this gap through engineering depth — not just a chatbot wrapper.

The system serves examiners, supervisors, and end-users through a cache-first FastAPI backend, premium static frontend, and Expo mobile app sharing the same REST API.

2. Problem Statement

PSX investors must manually cross-reference predictions, fundamentals, Shariah rules, and portfolio allocation. Existing tools are either pure screeners without AI reasoning, or chatbots without engineering rigor, persistence, or accuracy tracking.

3. Objectives

  • Multi-LLM + LSTM prediction with DB persistence
  • Dual Shariah screening: PSX-KMI (2026) + AAOIFI
  • Per-model portfolio Top 5/10/30/50 ranking
  • Transparent accuracy compare vs actual PSX prices
  • Mobile app with shared API architecture

Our AI Architecture

The proprietary PSXFusion™ AI Model orchestrates eight specialized engines into a single institutional-grade investment intelligence pipeline. Underlying algorithms (LSTM, LLM reasoning, technical indicators) remain unchanged — this is the professional identity of our hybrid architecture.

4. System Architecture

Layered architecture following modern web application design — client layer, application services, data persistence, and external integrations.

🖥 Client Layer
Web BrowserHTML / JS / Chart.js
Mobile AppReact Native / Expo
Live ServerPort 5500 (dev)
↓ HTTPS / REST
⚙ Application Layer — FastAPI (Port 8001)
Prediction EngineGROQ · OpenAI · Meta
Decision Engine5-Factor Hybrid Score
Shariah FilterPSX-KMI + AAOIFI
Portfolio RankerComposite Scoring
Market PipelinePSX DPS + Cache
🗄 Data & Infrastructure Layer
PostgreSQLPredictions · Actuals
JSON CachesMarket · Portfolio
SQLite FallbackDemo Mode
Background WorkersRefresh · Validate
🌐 External Services
PSX DPS APILive Market Watch
yFinanceHistorical OHLCV
GROQ APILLM Inference
OpenAI / MetaAlternative Models

5. Methodology & Workflow

Step 1 — Data Ingestion

PSX DPS market-watch provides 535+ live symbols. yFinance supplements historical OHLCV for technical indicators.

Step 2 — Multi-Model Prediction

Parallel GROQ, OpenAI, Meta calls + LSTM momentum proxy. Results persisted to PostgreSQL.

Step 3 — Shariah Screening

User selects PSX-KMI (official) or AAOIFI (stricter). Six-ratio rule engine with animated screening UX.

Step 4 — Portfolio Ranking

Composite score: 40% GenAI + 20% technical + 20% fundamental + 10% history + 10% risk.

Step 5 — Accuracy Evaluation

Stable post-regime evaluation: matched prediction-vs-actual pairs with direction accuracy, MAE, RMSE, and deployment scoring.

6. Technology Stack

Python 3FastAPIUvicorn PostgreSQLPandasyFinance PSX DPSGROQOpenAI Meta LLMChart.jsTailwind CSS React NativeExpo

7. Key Results

Model Accuracy

Loading stable evaluation metrics…

Stock Universe

535 PSX symbols via official DPS market-watch integrated across all dropdowns.

Dual Shariah

PSX-KMI 2026 rules (6 criteria) + AAOIFI global standard — user chooses framework.

Portfolio Intelligence

Separate Top 5/10/30/50 portfolios per GROQ, OpenAI, and Meta with benchmark overlap.

8. Deployment (Free Student Stack)

Backend

Render.com / Railway free tier — uvicorn api:app

Frontend

GitHub Pages / Vercel — static frontend/ folder

Mobile

Expo Go QR scan — set EXPO_PUBLIC_API_BASE_URL

Connect via frontend/api-config.json{"api_base":"https://your-app.onrender.com"}