Skip to content

DanielKaminsky05/Riskgaurd

Repository files navigation

RiskGuard - QHacks 2026

RiskGuard is a real-time trading bias detection system designed to help traders identify and mitigate psychological pitfalls like revenge trading and overtrading. By monitoring trading activity and intervening when necessary, RiskGuard aims to preserve capital and promote disciplined trading habits.

🚀 Features

  • Real-time Bias Detection: Analyzes trading patterns to detect emotional biases.
  • Intervention System: Alerts traders and provides friction to prevent impulsive decisions.
  • Capital Preservation Tracking: Visualizes potential losses avoided through interventions.
  • Trade Logging & Analysis: Comprehensive dashboard for reviewing trade history and performance.
  • LLM-Powered Insights: (Optional) Provides AI-driven analysis of trading behavior.

🏗️ Architecture

The project consists of three main components:

  1. Backend (/backend): A Flask-based API that handles data processing, bias detection logic, and communication with Snowflake.
  2. Frontend (/frontend): A Next.js web application serving as the user dashboard.
  3. Extension (/extension): A Chrome extension (built with WXT) that overlays trading platforms to provide real-time alerts.

🛠️ Prerequisites

  • Python 3.9+
  • Node.js 18+ & npm
  • Snowflake Account (for data storage)

📦 Installation & Setup

1. Backend Setup

The backend powers the analysis and data storage.

cd backend
# Create a virtual environment (optional but recommended)
python -m venv venv
# Windows
venv\Scripts\activate
# Mac/Linux
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt
# Note: You may also need 'snowflake-connector-python' if not already installed.
pip install snowflake-connector-python

Configuration: Ensure you have a .env file in the backend directory with your Snowflake credentials (USER, PASSWORD, ACCOUNT, WAREHOUSE, DATABASE, SCHEMA).

Run the Server:

python server.py
# The server will start at http://localhost:5000

2. Frontend Setup

The frontend provides the dashboard for analytics.

cd frontend
npm install
npm run dev
# The dashboard will be available at http://localhost:3000

3. Extension Setup

The extension integrates with your browser.

cd extension
npm install

# Run in development mode (loads into a temporary Chrome instance)
npm run dev

# Or build for production
npm run build
# The built extension will be in extension/.output/chrome-mv3
# Load this directory as an unpacked extension in chrome://extensions/

🖥️ Usage

  1. Start all services: Ensure Backend and Frontend are running. Load the Extension.
  2. Dashboard: Navigate to http://localhost:3000 to view your trading stats and recent interventions.
  3. Trading: (Demo Mode) Use the provided demo scripts or endpoints to simulate trading activity and observe how RiskGuard detects biases.
    • Start Demo Mode: POST /start_demo with {"user_id": "test_user"}
    • Seed Scenario: POST /seed_scenario with {"user_id": "test_user", "type": "revenge"}

🤝 Contributing

This project was built for QHacks 2026.

📄 License

MIT

About

Chrome Extension to detect common trading behavioral biases

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors