Skip to content

Sentinel Shield is a real-time AI surveillance platform designed to detect and prevent market manipulation schemes. Built for the Securities Market Hackathon, it protects retail investors from pump-and-dump scams through advanced multi-modal intelligence fusion.

License

Notifications You must be signed in to change notification settings

harshil748/Sentinel-Shield

Repository files navigation

๐Ÿ›ก๏ธ Sentinel Shield

Python FastAPI React License PRs Welcome

AI-Powered Market Fraud Detection Platform for India's Securities Market

Sentinel Shield is a sophisticated, real-time AI surveillance platform designed to detect and prevent market manipulation schemes. Built for the Securities Market Hackathon, it protects retail investors from pump-and-dump scams through advanced multi-modal intelligence fusion.

๐ŸŽฏ Mission

Safeguard market integrity and protect retail investors by providing regulators with cutting-edge AI-powered surveillance tools that detect fraudulent activity before it causes systemic harm.


โšก Quick Start

Prerequisites

  • Python 3.12+
  • Node.js 20+
  • Docker & Docker Compose

๐Ÿš€ One-Command Setup

# Clone the repository
git clone https://github.com/harshil748/Sentinel-Shield.git
cd Sentinel-Shield

# Start the database
docker-compose up -d

# Start backend (Terminal 1)
cd backend && pip install -r requirements.txt && uvicorn main:app --reload --port 8000

# Start frontend (Terminal 2)
cd frontend && npm install && npm run dev

๐ŸŒ Access the application: http://localhost:5173


๐Ÿ—๏ธ Architecture

Sentinel Shield employs a Trinity of Evidence approach, correlating signals from three distinct intelligence streams:

๐Ÿ” Social Intelligence Pipeline

  • NLP-powered analysis of social media platforms
  • Real-time sentiment analysis and manipulation detection
  • Entity recognition for coordinated messaging
  • Multi-language support for Indian markets

๐Ÿ“Š Market Intelligence Engine

  • Enhanced EWMA anomaly detection
  • ML Isolation Forest for pattern recognition
  • Volume spike detection via statistical analysis
  • Price momentum anomaly identification

โš–๏ธ Regulatory Intelligence Layer

  • SEBI intermediary verification with trust scoring
  • Entity credibility analysis
  • Risk level classification
  • Regulatory compliance tracking

๐Ÿ“ Project Structure

Sentinel-Shield/
โ”œโ”€โ”€ ๐Ÿ”ง backend/                 # FastAPI Backend
โ”‚   โ”œโ”€โ”€ main.py                 # Core AI models & API
โ”‚   โ””โ”€โ”€ requirements.txt        # Python dependencies
โ”œโ”€โ”€ ๐Ÿ–ฅ๏ธ frontend/                # React Frontend
โ”‚   โ”œโ”€โ”€ src/                    # Source code
โ”‚   โ”œโ”€โ”€ package.json            # Node.js dependencies
โ”‚   โ””โ”€โ”€ tailwind.config.js      # TailwindCSS config
โ”œโ”€โ”€ ๐Ÿณ docker-compose.yml       # PostgreSQL setup
โ”œโ”€โ”€ ๐Ÿ“‹ ARCHITECTURE.md          # Technical details
โ””โ”€โ”€ ๐Ÿ“š README.md               # This file

๐Ÿ› ๏ธ Technology Stack

Layer Technology Purpose
Backend FastAPI + Python 3.12 High-performance async API
AI/ML Scikit-learn + Pandas + NumPy Anomaly detection & NLP
Frontend React 19 + Vite + TailwindCSS Modern dashboard interface
Charts LightweightCharts Professional financial visualizations
Database PostgreSQL Time-series data storage
Deployment Docker + Docker Compose Containerized services

๐Ÿค– AI Detection Engine

Enhanced EWMA Anomaly Detection

  • Multi-timeframe analysis with trend divergence scoring
  • Z-score normalization for standardized alerts
  • Real-time pattern recognition

ML Isolation Forest

  • Feature engineering with 5+ technical indicators
  • Multi-dimensional anomaly scoring
  • Adaptive contamination thresholds

NLP Sentiment Analysis

  • Manipulation keyword detection with curated patterns
  • Financial context-aware sentiment scoring
  • Entity extraction for coordinated messaging

Trust Scoring Algorithm

  • SEBI verification with dynamic scoring (5-95 points)
  • Content analysis for manipulation indicators
  • Risk level classification (Low/Medium/High/Critical)

๐Ÿ–ผ๏ธ Dashboard Features

๐ŸŽฏ Live Market Threat Monitor

  • Real-time threat levels: Minimal โ†’ Low โ†’ Medium โ†’ High โ†’ Critical
  • Dynamic color coding for immediate risk assessment
  • Confidence scoring (0-100%) for manipulation detection

๐Ÿ“ˆ Interactive Charts

  • Professional financial visualizations using LightweightCharts
  • Real-time price and volume data
  • Anomaly highlighting with severity indicators

๐Ÿ” Investigation Hub

  • Historical alert analysis with advanced filtering
  • CSV export for compliance reporting
  • Deep forensic analysis with social media correlation

โš ๏ธ Alert System

  • 4-tier severity classification
  • Real-time alert feed with timestamps
  • Detailed manipulation confidence scores

๐Ÿ“Š Key Endpoints

Endpoint Method Description
/fetch_live_alert GET Real-time analysis with alert generation
/social_analysis GET Social media signal analysis
/threat_score GET Current market threat assessment
/alerts GET Historical alert queries with filters
/verify_entity GET Entity verification & trust scoring

๐Ÿ“š Full API Documentation: http://localhost:8000/docs


๐Ÿ”ง Development & Usage

Demo Scenarios

๐ŸŽฏ Pump-and-Dump Detection

# Test real-time manipulation detection
curl "http://localhost:8000/fetch_live_alert?symbol=RELIANCE.NSE"

๐Ÿ” Investigation Hub

# Query suspicious activity in last 24 hours
curl "http://localhost:8000/alerts?symbol=RELIANCE.NSE&since_hours=24"

๐ŸŒก๏ธ Market Threat Assessment

# Check current market threat level
curl "http://localhost:8000/threat_score"

Environment Configuration

# Backend environment variables
cd backend
cp .env.example .env
# Edit .env with your API keys (optional for demo mode)

๐Ÿงช Demo Mode & Simulations

The platform includes sophisticated simulation capabilities:

๐Ÿ“ˆ Realistic Market Data

  • Correlated price-volume movements with manipulation spikes
  • Time-series continuity with realistic trading patterns
  • Dynamic anomaly injection for demonstration

๐Ÿ’ฌ Social Media Signal Simulation

  • Contextual manipulation messages based on market conditions
  • Multi-platform signal generation (Telegram, WhatsApp, Twitter)
  • Coordinated timing with market anomalies

๐Ÿ† Trust Scoring Demo

  • Verified vs. unverified entity scenarios
  • Content-based credibility analysis
  • Dynamic risk level assignment

๐ŸŽฏ Impact & Use Cases

For Regulators (SEBI)

โœ… Proactive surveillance of messaging platforms
โœ… Evidence correlation for enforcement actions
โœ… Real-time market threat assessment
โœ… Compliance monitoring support

For Retail Investors

โœ… ScamAdvisor-style warnings for manipulated stocks
โœ… Entity verification before following advice
โœ… Educational awareness of manipulation tactics

For Brokers & Exchanges

โœ… Risk management API integration
โœ… Client activity monitoring for compliance
โœ… Market surveillance enhancement


๐Ÿšง Future Roadmap

๐Ÿ“… Phase 1 (Q1 2025)

  • Enhanced NLP for regional Indian languages
  • Expanded social media platform coverage
  • Real-time Telegram/WhatsApp integration

๐Ÿ“… Phase 2 (Q2 2025)

  • Deepfake detection for audio/video manipulation
  • Broker API integration for pilot programs
  • Advanced network analysis for coordination detection

๐Ÿ“… Phase 3 (Q3-Q4 2025)

  • Cryptocurrency market expansion
  • Predictive manipulation modeling
  • Cross-border surveillance capabilities

๐Ÿ† Competitive Advantages

๐ŸŽฏ Multi-modal Intelligence Fusion - Unique correlation of social and market signals
โšก Real-time Processing - Sub-second alert generation capability
๐Ÿ‡ฎ๐Ÿ‡ณ Indian Market Focus - Specialized for NSE/BSE and regional languages
โš–๏ธ Regulatory Alignment - Direct support for SEBI priorities
โ˜๏ธ Scalable Architecture - Cloud-native design for enterprise deployment


๐Ÿค Contributing

We welcome contributions! Please follow these steps:

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒฟ Create a feature branch (git checkout -b feature/enhancement)
  3. ๐Ÿ’พ Commit your changes (git commit -m 'Add new feature')
  4. ๐Ÿ“ค Push to the branch (git push origin feature/enhancement)
  5. ๐Ÿ”„ Open a Pull Request

Development Guidelines

  • Follow existing code style and formatting
  • Add tests for new functionality
  • Update documentation as needed
  • Ensure all checks pass before submitting

๐Ÿ“ž Support & Contact

Team: Praesidio Analytics
Mission: Protecting market integrity through advanced AI surveillance
Email: pharshil748@gmail.com

๐Ÿ“š Additional Resources


๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ›ก๏ธ Sentinel Shield

"Empowering regulators, protecting investors, securing markets through intelligent surveillance."

Your guardian against market manipulation.

GitHub stars GitHub forks

About

Sentinel Shield is a real-time AI surveillance platform designed to detect and prevent market manipulation schemes. Built for the Securities Market Hackathon, it protects retail investors from pump-and-dump scams through advanced multi-modal intelligence fusion.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors 2

  •  
  •